provision_Cr50TOT: migrate to python 3

BUG=b:199905485
TEST=none

Change-Id: I98c1dd06c5fe49dd6170a0277e4f0cf24dfda1d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/3223157
Tested-by: Mary Ruthven <mruthven@chromium.org>
Auto-Submit: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Aadit Maheshkumar Modi <modia@chromium.org>
Commit-Queue: Mary Ruthven <mruthven@chromium.org>
diff --git a/server/site_tests/provision_Cr50TOT/control b/server/site_tests/provision_Cr50TOT/control
index 8c5884c..d4d6cab 100644
--- a/server/site_tests/provision_Cr50TOT/control
+++ b/server/site_tests/provision_Cr50TOT/control
@@ -14,6 +14,7 @@
 TEST_CLASS = "provision"
 TEST_TYPE = "Server"
 DEPENDENCIES = "servo_state:WORKING,cr50-ro-keyid:dev"
+PY_VERSION = 3
 
 DOC = """
 Update the Cr50 to the TOT image from the latest reef build. This requires that
diff --git a/server/site_tests/provision_Cr50TOT/provision_Cr50TOT.py b/server/site_tests/provision_Cr50TOT/provision_Cr50TOT.py
index ca783f2..50523b6 100644
--- a/server/site_tests/provision_Cr50TOT/provision_Cr50TOT.py
+++ b/server/site_tests/provision_Cr50TOT/provision_Cr50TOT.py
@@ -8,7 +8,6 @@
 
 import logging
 import os
-import re
 
 from autotest_lib.client.common_lib.cros import cr50_utils
 from autotest_lib.client.common_lib import error
@@ -95,13 +94,6 @@
                              latest_builds)
 
 
-    def get_bin_version(self, dut_path):
-        """Get the cr50 version from the image."""
-        find_ver_cmd = 'grep -a cr50_v.*tpm2 %s' % dut_path
-        version_output = self.host.run(find_ver_cmd).stdout.strip()
-        return re.findall('cr50_v\S+\s', version_output)[0].strip()
-
-
     def run_once(self, host, force=False):
         """Update cr50 to the TOT image from the reef builder."""
         # TODO(mruthven): remove once the test is successfully scheduled.
@@ -115,19 +107,12 @@
         logging.info('cr50 image is at %s', cr50_path)
         local_path = os.path.join(self.resultsdir, 'cr50.bin.tot')
         self.host.get_file(cr50_path, local_path)
-        expected_version = self.get_bin_version(cr50_path)
 
         cr50_utils.GSCTool(self.host, ['-a', cr50_path])
 
         self.cr50.wait_for_reboot(
                 timeout=self.faft_config.gsc_update_wait_for_reboot)
         cr50_version = self.cr50.get_active_version_info()[3].split('/')[-1]
-        logging.info('Cr50 running %s. Expected %s', cr50_version,
-                     expected_version)
-        # TODO(mruthven): Decide if failing to update should be a provisioning
-        # failure. Raising a failure will prevent the suite from running. See
-        # how often it fails and why.
-        if cr50_version.split('/')[-1] != expected_version:
-            logging.info('Unable to udpate Cr50.')
+        logging.info('Cr50 running %s after update', cr50_version)
         filesystem_util.make_rootfs_writable(self.host)
         cr50_utils.InstallImage(self.host, local_path, cr50_utils.CR50_PREPVT)