When all the test are written I want to go back over them and extra common methods, variables to the base class.
Refactor nano_omaha_deveserver too. It's constructor vs setters are confusing to use.
Basically improve that whole nano_omaha_devserver class
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/autotest/+/80e3b8f96c082d08bba352e032e8a8fb08e30e8d commit 80e3b8f96c082d08bba352e032e8a8fb08e30e8d Author: David Haddock <dhaddock@chromium.org> Date: Sun Apr 22 18:42:30 2018 Refactor server side code a bit ahead of last few AU tests. We want to share common code between the client and server base classes. To do this I have introduced a new class update_engine_util. It will hold common variables and methods. The client and server base classes will then use multiple inheritance. To inherit from update_engine_util and the standard autotest test class. The differences between the client and server is the run() function used: either utils.run for client or host.run for server. The will be defined in the initialize() function of each base class. BUG= chromium:831034 BUG= chromium:817913 TEST=OOBE regular test, OOBE interrupt, new interrupt test, bad sha256 Change-Id: I4c22a8485c0ec30e27518de153371ec0cffba84d Reviewed-on: https://chromium-review.googlesource.com/1010884 Commit-Ready: David Haddock <dhaddock@chromium.org> Tested-by: David Haddock <dhaddock@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org> [add] https://crrev.com/80e3b8f96c082d08bba352e032e8a8fb08e30e8d/client/cros/update_engine/update_engine_util.py [modify] https://crrev.com/80e3b8f96c082d08bba352e032e8a8fb08e30e8d/client/site_tests/autoupdate_EOL/autoupdate_EOL.py [modify] https://crrev.com/80e3b8f96c082d08bba352e032e8a8fb08e30e8d/server/site_tests/autoupdate_NonBlockingOOBEUpdate/autoupdate_NonBlockingOOBEUpdate.py [modify] https://crrev.com/80e3b8f96c082d08bba352e032e8a8fb08e30e8d/client/site_tests/autoupdate_UrlSwitch/autoupdate_UrlSwitch.py [modify] https://crrev.com/80e3b8f96c082d08bba352e032e8a8fb08e30e8d/server/cros/update_engine/omaha_devserver.py [modify] https://crrev.com/80e3b8f96c082d08bba352e032e8a8fb08e30e8d/server/site_tests/autoupdate_P2P/autoupdate_P2P.py [modify] https://crrev.com/80e3b8f96c082d08bba352e032e8a8fb08e30e8d/client/site_tests/autoupdate_Backoff/autoupdate_Backoff.py [modify] https://crrev.com/80e3b8f96c082d08bba352e032e8a8fb08e30e8d/client/site_tests/autoupdate_StartOOBEUpdate/autoupdate_StartOOBEUpdate.py [modify] https://crrev.com/80e3b8f96c082d08bba352e032e8a8fb08e30e8d/server/site_tests/autoupdate_Cellular/autoupdate_Cellular.py [modify] https://crrev.com/80e3b8f96c082d08bba352e032e8a8fb08e30e8d/client/cros/update_engine/update_engine_test.py [modify] https://crrev.com/80e3b8f96c082d08bba352e032e8a8fb08e30e8d/server/cros/update_engine/update_engine_test.py [modify] https://crrev.com/80e3b8f96c082d08bba352e032e8a8fb08e30e8d/client/site_tests/autoupdate_BadMetadata/autoupdate_BadMetadata.py [modify] https://crrev.com/80e3b8f96c082d08bba352e032e8a8fb08e30e8d/server/site_tests/autoupdate_ForcedOOBEUpdate/autoupdate_ForcedOOBEUpdate.py
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/autotest/+/2fd9aec66ebf1411565262dea77f7599db17fe4f commit 2fd9aec66ebf1411565262dea77f7599db17fe4f Author: David Haddock <dhaddock@chromium.org> Date: Thu Apr 26 06:00:32 2018 More refactoring and fixes for some failing tests. Refactoring includes: - Added Functions for getting multiple logs. - Remove setting self._host in every test - Remove printing update URL in every test. Fixes: EOL: Daisy is failing because we are calling update too soon after restarting update engine. So I will just not restart it before the test. P2P: I am resetting the current url index before I reboot. Disconnect internet: Occasionally it fails because the progress moves from 0.200001 to 0.200002. So I am just waiting for a bit for it to settle. Cellular tests: Have been failing after I incorrectly changed a variable name from cellular to public. BUG= chromium:833518 BUG= chromium:817913 BUG= chromium:817908 TEST=all au tests. Change-Id: I208b54e6c7c4076f4a6ecadb94e4c1bac69a3be7 Reviewed-on: https://chromium-review.googlesource.com/1025398 Commit-Ready: David Haddock <dhaddock@chromium.org> Tested-by: David Haddock <dhaddock@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org> [modify] https://crrev.com/2fd9aec66ebf1411565262dea77f7599db17fe4f/client/cros/update_engine/update_engine_util.py [modify] https://crrev.com/2fd9aec66ebf1411565262dea77f7599db17fe4f/client/site_tests/autoupdate_EOL/autoupdate_EOL.py [modify] https://crrev.com/2fd9aec66ebf1411565262dea77f7599db17fe4f/server/site_tests/autoupdate_NonBlockingOOBEUpdate/autoupdate_NonBlockingOOBEUpdate.py [modify] https://crrev.com/2fd9aec66ebf1411565262dea77f7599db17fe4f/server/site_tests/autoupdate_OmahaResponse/autoupdate_OmahaResponse.py [modify] https://crrev.com/2fd9aec66ebf1411565262dea77f7599db17fe4f/server/site_tests/autoupdate_P2P/autoupdate_P2P.py [modify] https://crrev.com/2fd9aec66ebf1411565262dea77f7599db17fe4f/client/site_tests/autoupdate_Backoff/autoupdate_Backoff.py [modify] https://crrev.com/2fd9aec66ebf1411565262dea77f7599db17fe4f/client/site_tests/autoupdate_DisconnectReconnectNetwork/autoupdate_DisconnectReconnectNetwork.py [modify] https://crrev.com/2fd9aec66ebf1411565262dea77f7599db17fe4f/client/site_tests/autoupdate_StartOOBEUpdate/autoupdate_StartOOBEUpdate.py [modify] https://crrev.com/2fd9aec66ebf1411565262dea77f7599db17fe4f/client/cros/update_engine/nano_omaha_devserver.py [modify] https://crrev.com/2fd9aec66ebf1411565262dea77f7599db17fe4f/server/site_tests/autoupdate_Cellular/autoupdate_Cellular.py [modify] https://crrev.com/2fd9aec66ebf1411565262dea77f7599db17fe4f/client/cros/update_engine/update_engine_test.py [modify] https://crrev.com/2fd9aec66ebf1411565262dea77f7599db17fe4f/server/cros/update_engine/update_engine_test.py [modify] https://crrev.com/2fd9aec66ebf1411565262dea77f7599db17fe4f/server/site_tests/autoupdate_ForcedOOBEUpdate/autoupdate_ForcedOOBEUpdate.py
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/autotest/+/26b9cc16e528e2e6bd3fd13dcb74f99aef2938ae commit 26b9cc16e528e2e6bd3fd13dcb74f99aef2938ae Author: David Haddock <dhaddock@chromium.org> Date: Fri May 04 10:02:39 2018 Remove the update engine restart at the beginning of tests. This was added to make looking at logs easier during development. It is pretty unnatural to test in this way because users devices will not do this. Restarting update engine and then immediately trying to update is making tests fail sometimes so insteaad of adding an even more unnatural wait, I will remove the restart. BUG= chromium:817913 TEST=None Change-Id: I48bde9ac975f04c977c1c87a5f759eb781ba0341 Reviewed-on: https://chromium-review.googlesource.com/1040651 Commit-Ready: David Haddock <dhaddock@chromium.org> Tested-by: David Haddock <dhaddock@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Katherine Threlkeld <kathrelkeld@chromium.org> [modify] https://crrev.com/26b9cc16e528e2e6bd3fd13dcb74f99aef2938ae/client/site_tests/autoupdate_Backoff/autoupdate_Backoff.py [modify] https://crrev.com/26b9cc16e528e2e6bd3fd13dcb74f99aef2938ae/client/site_tests/autoupdate_BadMetadata/autoupdate_BadMetadata.py [modify] https://crrev.com/26b9cc16e528e2e6bd3fd13dcb74f99aef2938ae/client/site_tests/autoupdate_UrlSwitch/autoupdate_UrlSwitch.py
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/autotest/+/7d1fa7706617c11050713585043c3ae18a60db48 commit 7d1fa7706617c11050713585043c3ae18a60db48 Author: Katherine Threlkeld <kathrelkeld@google.com> Date: Wed Jul 18 08:40:07 2018 Autotest: refactor nano_omaha_devserver Make some changes that will be useful for Enterprise AU tests. Refactored nano_omaha_devserver to make it easier to edit the server response. Moved the response creation out of the Handler class to avoid passing so much info and switched to templatized interface with variable names. Added in flags for rollback and the option to change the build number. Added an init to update_engine_util to set self._run. Moved the _create_custom_lsb_release() function from a sub-test into the common util and added a _clear_custom_lsb_release(). Removed the self._run and self._getfile creation in the testing template, since they are created in *_util now. Moved a single test's setup() into an initialize since the new lsb_release function can't be run until after initialize has been run. Existing tests which depend on nano_omaha: autoupdate_EOL autoupdate_OmahaResponse autoupdate_ForcedOOBEUpdate autoupdate_NonBlockingOOBEUpdate autoupdate_CatchBadSignatures autoupdate_Cellular TEST=manually inspected nano_omaha_devserver response combinations. Ran the autoupdate_ tests impacted by this change and saw no major differences compared to prod runs. BUG= chromium:817913 Change-Id: Idd8ab99b86c3ac2a5d195c66bf5c5b28217d9527 Reviewed-on: https://chromium-review.googlesource.com/1107298 Commit-Ready: Katherine Threlkeld <kathrelkeld@chromium.org> Tested-by: Katherine Threlkeld <kathrelkeld@chromium.org> Reviewed-by: David Haddock <dhaddock@chromium.org> [modify] https://crrev.com/7d1fa7706617c11050713585043c3ae18a60db48/client/cros/update_engine/update_engine_test.py [modify] https://crrev.com/7d1fa7706617c11050713585043c3ae18a60db48/client/cros/update_engine/update_engine_util.py [modify] https://crrev.com/7d1fa7706617c11050713585043c3ae18a60db48/client/site_tests/autoupdate_StartOOBEUpdate/autoupdate_StartOOBEUpdate.py [modify] https://crrev.com/7d1fa7706617c11050713585043c3ae18a60db48/client/cros/update_engine/nano_omaha_devserver.py
This was done
Comment 1 by dhadd...@chromium.org
, Mar 2 2018