xref: /aosp_15_r20/external/autotest/server/site_tests/stub_PassServer/stub_PassServer.py (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1# Copyright (c) 2013 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
5from autotest_lib.client.common_lib import error
6from autotest_lib.client.common_lib import utils
7from autotest_lib.server import test
8
9
10class stub_PassServer(test.test):
11    """Tests that server tests can pass."""
12    version = 1
13
14    def run_once(self, expect_ssp=None):
15        """There is no body for this test.
16
17        @param expect_ssp: If True, ensure test is running inside a container.
18                If False, ensure test is not running inside a container.
19                If None (default), do nothing.
20        """
21        if expect_ssp is not None:
22            if expect_ssp and not utils.is_in_container():
23                raise error.TestFail(
24                        'The test is not running inside container')
25            if not expect_ssp and utils.is_in_container():
26                raise error.TestFail('Test test is running inside container')
27