autoupdate_Basic: Check for correct kernel before verifying logs.

Seeing this error: "list index out of range" when trying to verify the
hostlog of an update that just completed. It is trying to access the
update_engine.log for the update that just happened before reboot but
they are not available.

So check that we are in the right partition before verifying the logs.
Also make the error message clearer when this happens.

BUG=chromium:1143742
TEST=autoupdate_Basic

Change-Id: I211e9cd076c8bbdcae01b03f9513d4dbb81defdc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2508455
Commit-Queue: David Haddock <dhaddock@chromium.org>
Tested-by: David Haddock <dhaddock@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/server/cros/update_engine/update_engine_test.py b/server/cros/update_engine/update_engine_test.py
index fd92144..0611fe9 100644
--- a/server/cros/update_engine/update_engine_test.py
+++ b/server/cros/update_engine/update_engine_test.py
@@ -511,6 +511,11 @@
         rootfs update and for the post reboot update check.
 
         """
+        # Check that update logs exist for the update that just happened.
+        if len(self._get_update_engine_logs()) < 2:
+            err_msg = 'update_engine logs are missing. Cannot verify update.'
+            raise error.TestFail(err_msg)
+
         # Each time we reboot in the middle of an update we ping omaha again
         # for each update event. So parse the list backwards to get the final
         # events.
diff --git a/server/site_tests/autoupdate_Basic/autoupdate_Basic.py b/server/site_tests/autoupdate_Basic/autoupdate_Basic.py
index a7f55d0..e256bbd 100644
--- a/server/site_tests/autoupdate_Basic/autoupdate_Basic.py
+++ b/server/site_tests/autoupdate_Basic/autoupdate_Basic.py
@@ -31,6 +31,6 @@
 
         # Verify the update completed successfully.
         self._host.reboot()
+        kernel_utils.verify_boot_expectations(inactive, host=self._host)
         rootfs_hostlog, _ = self._create_hostlog_files()
         self.verify_update_events(self._FORCED_UPDATE, rootfs_hostlog)
-        kernel_utils.verify_boot_expectations(inactive, host=self._host)