Add CI TMT

Resolves: RHEL-62167
This commit is contained in:
Takao Fujiwara 2024-10-11 09:26:11 +09:00
parent aba7e65a1b
commit e796618c64
5 changed files with 56 additions and 0 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

5
plans/test.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

5
tests/base/main.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Simple test of python-pycotap
test: ./test.sh
framework: beakerlib
require:
- python3-pycotap

36
tests/base/test.py Executable file
View File

@ -0,0 +1,36 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import unittest
import sys
from pycotap import TAPTestRunner
from pycotap import LogMode
class SimpleTest(unittest.TestCase):
@classmethod
def function_name(cls):
return sys._getframe().f_back.f_code.co_name
@classmethod
def setUpClass(cls):
print(cls.function_name())
def setUp(self):
print(SimpleTest.function_name())
def main(self):
print(SimpleTest.function_name())
def test_foo(self):
print(SimpleTest.function_name())
def main():
loader = unittest.TestLoader()
runner = TAPTestRunner(test_output_log=LogMode.LogToError)
unittest.main(testRunner=runner, testLoader=loader)
if __name__ == '__main__':
main()

9
tests/base/test.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
. /usr/share/beakerlib/beakerlib.sh || exit 1
rlJournalStart
rlPhaseStartTest
rlRun -t "./test.py"
rlPhaseEnd
rlJournalEnd