autoupdate.py: Don't try to to fetch update payloads
All autotests we run first stage their update payloads before calling
into devserver. This CL removes the dance that autoupdate.py is doing to
get the exact path to the image because that's not needed anymore. We
only need the path to the directory where the payloads are located. The
nebraska.py knows how to find the correct payloads from that directory.
BUG=chromium:1149703
TEST=run devserver locally, then staged delta payloads:
curl 'http://localhost:8080/stage?archive_url=gs://chromeos-image-archive/reef-release/R88-13591.0.0&artifacts=delta_payload'
Then got a noupdate for this URL:
curl -X POST -d @/mnt/host/source/images/request.xml 'http://localhost:8080/update/reef-release/R88-13591.0.0?full_payload=True&critical_update=True
Got an update for this URL:
curl -X POST -d @/mnt/host/source/images/request.xml 'http://localhost:8080/update/reef-release/R88-13591.0.0?full_payload=False&critical_update=True
Change-Id: I301a799a6b41eeb9b3164806e5d2038e7efb8f1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2570637
Tested-by: Amin Hassani <ahassani@chromium.org>
Auto-Submit: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Keith Haddow <haddowk@chromium.org>
diff --git a/autoupdate_unittest.py b/autoupdate_unittest.py
index 648ef7c..cd7263a 100755
--- a/autoupdate_unittest.py
+++ b/autoupdate_unittest.py
@@ -8,7 +8,6 @@
from __future__ import print_function
-import json
import shutil
import socket
import tempfile
@@ -84,16 +83,6 @@
r = autoupdate._ChangeUrlPort('ftp://fuzzy', 8085)
self.assertEqual(r, 'ftp://fuzzy:8085')
- def testHandleHostInfoPing(self):
- au_mock = self._DummyAutoupdateConstructor()
- self.assertRaises(AssertionError, au_mock.HandleHostInfoPing, None)
-
- # Setup fake host_infos entry and ensure it comes back to us in one piece.
- test_ip = '1.2.3.4'
- au_mock.host_infos.GetInitHostInfo(test_ip).attrs = self.test_dict
- self.assertEqual(
- json.loads(au_mock.HandleHostInfoPing(test_ip)), self.test_dict)
-
@mock.patch.object(autoupdate.Autoupdate, 'GetPathToPayload')
def testHandleUpdatePing(self, path_to_payload_mock):
"""Tests HandleUpdatePing"""
@@ -109,7 +98,8 @@
</app>
</request>"""
- self.assertIn('error-unknownApplication', au_mock.HandleUpdatePing(request))
+ self.assertIn('<updatecheck status="noupdate"',
+ au_mock.HandleUpdatePing(request))
if __name__ == '__main__':
unittest.main()