auto_updater: Use nebraska.py instead of devserver

Currently, cros flash et al. copy the entire devserver code (along with
its necessary dependencies) to the DUT to perform system updates. We
want to move away from this design by using a much simpler program
(nebraska.py) instead of the entire devserver.

Starting with this CL, we no longer copy use the devserver code in the
DUT to perform provisioning/update. We instead, only rely on nebraska.py
to do such actions. Hence the devserver code will be free to be moved to
some place else more appropriate (chromite?).

This CL introduces nebraska_wrapper.RemoteNebraskawrapper class. This
class can spawn a nebraska process on the DUT, start it, stop it, and
access its properties on demand. This is a simplified version of
dev_server_wrapper.

BUG=chromium:872441
TEST=unittests
TEST=
Ran two times to account for caching and both inside and outside chroot:
    `cros flash --debug <IP> local/reef/latest/test`
Ran two times for caching and both inside and outside chroot:
    `cros flash --debug <IP> xbuddy://remote/reef/latest-canary/test`
Ran two times to account for caching and both inside and outside chroot:
    `cros flash --debug <IP> chromiumos_test_image.bin
Ran inside cros chrome-sdk (simple chrome workflow) after patching the
chrome's chromite with these changes.
TEST= autoupdate_EndToEnd auto tests (instructions in its control file).

Cq-Depend: chromium:1797194
Change-Id: I49852e6f8c50baf9a0e4d14a3e1a6b7342e17f29
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1546551
Commit-Queue: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/cli/flash.py b/cli/flash.py
index 10b5bfd..3628c74 100644
--- a/cli/flash.py
+++ b/cli/flash.py
@@ -332,7 +332,6 @@
 
 class RemoteDeviceUpdater(object):
   """Performs update on a remote device."""
-  DEVSERVER_FILENAME = 'devserver.py'
   STATEFUL_UPDATE_BIN = '/usr/bin/stateful_update'
   UPDATE_ENGINE_BIN = 'update_engine_client'
   # Root working directory on the device. This directory is in the
@@ -432,6 +431,9 @@
       logging.info('Board is %s', self.board)
 
       # Translate the xbuddy path to get the exact image to use.
+
+      # TODO(crbug.com/872441): Once devserver code has been moved to chromite,
+      # use xbuddy library directly instead of the devserver_wrapper.
       translated_path, _ = ds_wrapper.GetImagePathWithXbuddy(
           self.image, self.board, static_dir=DEVSERVER_STATIC_DIR)
       image_path = ds_wrapper.TranslatedPathToLocalPath(
@@ -442,12 +444,12 @@
                    image_path, payload_dir)
 
     # Generate rootfs and stateful update payloads if they do not exist.
-    payload_path = os.path.join(payload_dir, ds_wrapper.ROOTFS_FILENAME)
+    payload_path = os.path.join(payload_dir, auto_updater.ROOTFS_FILENAME)
     if not os.path.exists(payload_path):
       paygen_payload_lib.GenerateUpdatePayload(
           image_path, payload_path, src_image=self.src_image_to_delta)
     if not os.path.exists(os.path.join(payload_dir,
-                                       ds_wrapper.STATEFUL_FILENAME)):
+                                       auto_updater.STATEFUL_FILENAME)):
       paygen_stateful_payload_lib.GenerateStatefulPayload(image_path,
                                                           payload_dir)
     return payload_dir