diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2021-10-06 16:53:43 -0400 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2021-10-11 15:14:32 -0400 |
commit | ca8d95c243dacb367c0b11c5190d5ec56e402afd (patch) | |
tree | 17fa6be3f3ad00fe9ed9827e1a5eaebdf06d9a07 /tests/unittests/sosreport_pexpect.py | |
parent | 58902e8f08d3c432541f6fc037999daafb9d5b4f (diff) | |
download | sos-ca8d95c243dacb367c0b11c5190d5ec56e402afd.tar.gz |
[tests] Run unit tests under avocado instead of nose
`nose` is no longer maintained, and as of python-3.10 is functionally
broken. As such, instead transition to running those tests via avocado,
like we do with our integration test suite.
The tests themselves do not need much modification, however due to the
isolation provided for executing the tests we do need to explicitly set
a new PYTHONPATH env var for those executions. This means we still need
to run the unit tests as a separate step from the stageone tests.
The changes needed are mostly around file paths relative to the pwd
where the tests are executed from originally.
Additionally, remove the sosreport_pexpect unit test as it is no longer
useful in its own right, would need more significant changes to run
properly with avocado, and the integration test suite provides better
coverage for what it was testing.
Closes: #2716
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Diffstat (limited to 'tests/unittests/sosreport_pexpect.py')
-rw-r--r-- | tests/unittests/sosreport_pexpect.py | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/tests/unittests/sosreport_pexpect.py b/tests/unittests/sosreport_pexpect.py deleted file mode 100644 index 3614fa5b..00000000 --- a/tests/unittests/sosreport_pexpect.py +++ /dev/null @@ -1,36 +0,0 @@ -# This file is part of the sos project: https://github.com/sosreport/sos -# -# This copyrighted material is made available to anyone wishing to use, -# modify, copy, or redistribute it subject to the terms and conditions of -# version 2 of the GNU General Public License. -# -# See the LICENSE file in the source distribution for further information. -import unittest -import pexpect - -from os import kill -from signal import SIGINT - - -class PexpectTest(unittest.TestCase): - def test_plugins_install(self): - sos = pexpect.spawn('/usr/sbin/sosreport -l') - try: - sos.expect('plugin.*does not install, skipping') - except pexpect.EOF: - pass - else: - self.fail("a plugin does not install or sosreport is too slow") - kill(sos.pid, SIGINT) - - def test_batchmode_removes_questions(self): - sos = pexpect.spawn('/usr/sbin/sosreport --batch') - grp = sos.expect('send this file to your support representative.', 15) - self.assertEquals(grp, 0) - kill(sos.pid, SIGINT) - - -if __name__ == '__main__': - unittest.main() - -# vim: set et ts=4 sw=4 : |