#! /usr/bin/python3 # SPDX-License-Identifier: GPL-2.0-or-later # # avocado/common.py - Avocado test helper routines # # Copyright Red Hat # Author: David Gibson import avocado from avocado.utils.process import system_output, CmdError class BaseTest(avocado.Test): # Fairly short timeout by default timeout = 5.0 def hostx(self, cmd, **kwargs): return system_output(cmd, **kwargs) # # Tests for the test infrastructure itself # class HostExecTests(BaseTest): def test_true(self): self.hostx('true') def test_false(self): self.assertRaises(CmdError, self.hostx, 'false')