1# Copyright (c) 2020 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 logging 6import os 7 8from autotest_lib.client.bin import test 9from autotest_lib.client.common_lib import error 10 11class dummy_SynchronousOffload(test.test): 12 version = 1 13 14 def initialize(self): 15 pass 16 17 def run_once(self): 18 DIR = os.getenv('SYNCHRONOUS_OFFLOAD_DIR', "") 19 if DIR == "": 20 raise error.TestFail("Did not find value for SYNCHRONOUS_OFFLOAD_DIR") 21 if not os.path.isdir(DIR): 22 raise error.TestFail("$SYNCHRONOUS_OFFLOAD_DIR=%s, which is not " 23 "a valid directory." % DIR) 24 logging.debug("Writing to directory %s", DIR) 25 with open(os.path.join(DIR,"test_file"), "w") as f: 26 f.write("Test string which should be offloaded") 27 logging.debug("Wrote string to test file.") 28 29 def cleanup(self): 30 pass 31