1# Copyright 2021 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import sys
6
7from autotest_lib.client.common_lib import error
8from autotest_lib.server import autotest
9from autotest_lib.server import test
10
11
12class infra_ServerPythonVersion(test.test):
13    """Checks the version on the server, then client."""
14    version = 1
15
16    def run_once(self, host, case):
17        """
18        Starting point of this test.
19
20        Note: base class sets host as self._host.
21
22        """
23        self.host = host
24
25        self.autotest_client = autotest.Autotest(self.host)
26        if sys.version_info.major != case:
27            raise error.TestFail("Not running in python version %s" % case)
28
29        self.autotest_client.run_test('infra_PythonVersion',
30                                      case=case,
31                                      check_client_result=True)
32