nebraska: Add a conf file

With this new .conf file (that will be put in /etc/init), we can bring
up nebraska.py with upstart only on test images before update_engine
comes up. This allows us to run some of the AU tests (like interrupt
tests) that currently we can't run (because they need the nebraska be up
right after system startup) and we can't access to device fast enough to
bring up nebraska.py.

Also added a --poll flag to nebraska.py so it can be called by this flag
to wait for a previous run of nebraska.py generates its pid/port files.

BUG=b:184980277
TEST=created a simple config.json file and did:
$ start nebraska
Then
$ cat /tmp/nebraska.log
INFO:root:Starting nebraska ...
DEBUG:root:Config updated to:
{'critical_update': False,
 'disable_payload_backoff': False,
 'eol_date': None,
 'failures_per_url': None,
 'full_payload': None,
 'ignore_appid': False,
 'install_app_index': <__main__.AppIndex object at 0x7cc01c1cd6d0>,
 'install_payloads_address': 'http://127.0.0.1:8080/',
 'is_rollback': False,
 'no_update': False,
 'num_urls': 1,
 'return_noupdate_starting': 0,
 'update_app_index': <__main__.AppIndex object at 0x7cc01c1cd650>,
 'update_payloads_address': 'http://127.0.0.1:8080/'}
INFO:root:Started nebraska on port 37691 and pid 27649.
DEBUG:root:Config updated to:
{'critical_update': True,
 'disable_payload_backoff': False,
 'eol_date': None,
 'failures_per_url': None,
 'full_payload': None,
 'ignore_appid': False,
 'install_app_index': <__main__.AppIndex object at 0x7cc01c1cd6d0>,
 'install_payloads_address': 'http://127.0.0.1:8080/',
 'is_rollback': False,
 'no_update': False,
 'num_urls': 1,
 'return_noupdate_starting': 0,
 'update_app_index': <__main__.AppIndex object at 0x7cc01c1cd650>,
 'update_payloads_address': 'http://127.0.0.1:8080/'}

which means the update config was successfully applied.

Change-Id: Iaa5ab473916ac5050a5b1f0919a8d4160559fab5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2819280
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Jae Hoon Kim <kimjae@chromium.org>
Commit-Queue: Amin Hassani <ahassani@chromium.org>
2 files changed