1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| | #! /usr/bin/python3
# SPDX-License-Identifier: GPL-2.0-or-later
#
# avocado/common.py - Avocado test helper routines
#
# Copyright Red Hat
# Author: David Gibson <david@gibson.dropbear.id.au>
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')
|