Package: os-tests
os-testsIntroductionos-tests is a lightweight, portable and customer centric tests collection for Linux OS.InstallationInstall from pypi# pip install os-testsNote: please installparamikoif run os-tests in server-client mode.There is an pynacl issue when installing paramiko on RHEL-8.6. Please install previous pynacl version (1.4.0) instead.Install from source code repo directly# pip install git+https://github.com/virt-s1/os-tests.git@masterBuild wheel locally and install it# git clone https://github.com/virt-s1/os-tests.git# cd os-tests# python3 setup.py sdist bdist_wheel# pip install -U dist/os_tests-0.0.3-py3-none-any.whlnote: the default bin path is "/usr/local/bin" if not in virtual environment.Public new wheels onpypi(maintainer use only)# python3 -m twine upload  dist/*Run testos-tests supports 3 working modesMode 1 -  single node usedInstall and run tests inside the RHEL system directly, fewer cases than Mode 2 and 3, lacking of tests requiring reboot system and instance control access.# os-testsor# python3 -m unittest -v os_tests.os_tests_runMode 2 - server client with 2 nodes usedRequire ssh user, key/password and IP to access existing RHEL system, all tests are done remotely, can do lifecyle, kdump test, but without device hotplug capability and other tests require instance access.# os-tests --host <remote_node> --user <remote_user> --keyfile <remote_keyfile> --result <result_dir> -p <cases>Mode 3 - server client with 1 node used, os-tests can provision test system selfRequire cloud/platform account to provision remote system self, can do full test with full control of instance. Eg. device hotplug, snapshot creation, send nmi events......Note: supports alicloud, aws, gcp, openstack, libvirt, nutanix, openshift, openstack and other platforms are in planning. The config template is under cfg dir.# os-tests -p cloudinit --user ec2-user --keyfile /home/virtqe_s1.pem --platform_profile aws_env.yamlMore optionsList all supported cases only without run# os-tests -lFilter case name with keywords ltp and virtwhat# os-tests -l -p ltp,virtwhatFilter case name with keywords ltp and skip test_ltp_ipsec_icmp# os-tests -l -p ltp -s test_ltp_ipsec_icmpRun all cases in one file# os-tests -p test_general_checkRun a single case in one file# os-tests -p test_change_clocksourceAll installed files and dirsYou can list all installed files viapip show -f os-testssimply.os_tests
├──cfg->configrationfiles
├──data->datafilesforlogchecking
├──libs->libsincludingresource(vm,disk,network)/funcdefinenation
├──templates->templateforgeneratinghtml,xmlreport
├──tests->alltestsfileslocation
└──utils->3rdpartyutils,ltp,blktestsandothersRecommended pkgs in test systemos-tests will try to install required pkgs from default repo during run, but it would be better to have them if no repo provided.
List RHEL only because CentOS Stream and Fedora usually have public repo available.RHEL-7: install,automake,autoconf,sysstat,gcc,unzip,wget,quota,bzip2,iperf3,pciutils,fio,psmisc,expect,ntpdate,perf,nvme-cli,pciutils,fio,git,tar,nfs-utils,libvirt,qemu-kvm,kernel-debug,python3,dracut-fips,podman,strace,sosRHEL-8: make,automake,autoconf,sysstat,gcc,unzip,wget,quota,bzip2,iperf3,pciutils,fio,psmisc,expect,perf,nvme-cli,pciutils,fio,php-cli,php-xml,php-json,libaio-devel,blktrace,fio,nvme-cli,git,tar,nfs-utils,libvirt,qemu-kvm,kernel-debug,python3,dracut-fips,podman,xdp-tools,openssl-devel,strace,sos,acpid,mokutil,kernel-modules-extra,iproute-tcRHEL-9: make,automake,autoconf,sysstat,gcc,unzip,wget,quota,bzip2,iperf3,pciutils,fio,psmisc,expect,perf,nvme-cli,pciutils,fio,libaio-devel,blktrace,fio,nvme-cli,git,tar,nfs-utils,libvirt,qemu-kvm,python3,dracut-fips,kernel-debug,python3-pip,hostname,podman,xdp-tools,openssl-devel,glibc-all-langpacks,strace,sos,acpid,mokutil,kernel-modules-extra,iproute-tcThe log fileThe suite saves the summary to sum.html and sum.log under "/tmp/os_tests_result/" by default.
The test debug log files are saved in "/tmp/os_tests_result/attachments" following case name by default.
You can change "results_dir" in "cfg/os-tests.yaml" to save log to other place or passing as command option.Below is an example:#  os-tests -p test_change_clocksourceRuninmode:is_listcase:Falsepattern:test_change_clocksource
test_change_clocksource(os_tests.tests.test_general_test.TestGeneralTest)...ok
----------------------------------------------------------------------
summaryinhtml:/tmp/os_tests_result/sum.html
summaryintext:/tmp/os_tests_result/sum.log
----------------------------------------------------------------------
Ran1testin0.383s

OK# ls -l /tmp/os_tests_result/debug/total8-rw-r--r--.1rootroot5472Mar3016:44os_tests.tests.test_general_test.TestGeneralTest.test_change_clocksource.debugRecommend test matrix to catch potential issuesrun in normal kernel, it is the most used scenariorun in debug kernel with 'kmemleak=on'(docs)run in fips enabled kernel (docs)run in remote-client mode to cover lifecycle casesThird party utilsBelow tools are shiped under 'utils' directory with os-tests because not all systems can reach github.ltp x86_64:https://github.com/liangxiao1/rpmbuild_specs/releases/latest/download/ltp-master.x86_64.rpmltp aarch64:https://github.com/liangxiao1/rpmbuild_specs/releases/latest/download/ltp-master.aarch64.rpmblktests x86_64:https://github.com/liangxiao1/rpmbuild_specs/releases/latest/download/blktests-master.x86_64.rpmblktests aarch64:https://github.com/liangxiao1/rpmbuild_specs/releases/latest/download/blktests-master.aarch64.rpmContributionYou are welcome to create pull request or raise issue. New case from real customer scenario or rhbz is preferred.Developing tool VS code is recommended withrefnowplugin which ships the newest case doc template.If adding case, please verify case doc before pushing.$os-tests--verifydoc-p<casename>To dump cases doc to yaml file.$os-tests-p<casename>--dumpdoc/tmp/cases.yaml