Adding in standard tier0 tests folder:

- The tier0 functional test where failing to kick off. Adding in
  tests folder with ansible test.

Resolves: rhbz#1975886
Signed-off-by: Chris White <chwhite@redhat.com>
This commit is contained in:
Chris White 2021-08-16 17:01:24 +00:00
parent 903ac850cd
commit 1d651cd284
3 changed files with 98 additions and 0 deletions

2
tests/README Normal file
View File

@ -0,0 +1,2 @@
initial tests:
build the pacakge and run the test suite on the SUT's sysfs directory

48
tests/smoke/runtest.sh Normal file
View File

@ -0,0 +1,48 @@
#!/bin/bash
# Get to the test directory
cd ../source/
#build the source tree to get the tests
./configure
make
#go to the test directory
cd test
#run the get_module test on every loaded module, if any command exits non-zero,
#fail the test
for i in `awk '{print $1}' /proc/modules`
do
./get_module $i
if [ $? -ne 0 ]
then
echo "GET MODULE FAILED ON $i"
exit 1
fi
done
#run the get_device test on pci and usb busses
for i in `ls /sys/bus/pci/devices`
do
./get_device pci $i
if [ $? -ne 0 ]
then
echo "GET DEVICE FAILED ON PCI DEV $i"
exit 1
fi
done
for i in `ls /sys/bus/usb/devices`
do
./get_device usb $i
if [ $? -ne 0 ]
then
echo "GET DEVICE FAILED ON USB DEV $i"
exit 1
fi
done
#If we get here all tests passed, exit 0
exit 0

48
tests/tests.yaml Normal file
View File

@ -0,0 +1,48 @@
---
- hosts: localhost
tags:
- classic
tasks:
- name: Add executor host
add_host:
name: executor
ansible_connection: local
ansible_host: 127.0.0.1
ansible_ssh_connection: local
- name: Install build requires
delegate_to: executor
shell: dnf -y install autoconf automake
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-source
- hosts: localhost
tags:
- classic
tasks:
- name: Copy spec file to remote machine
copy:
src: "{{ playbook_dir }}/../sysfsutils.spec"
dest: /tmp/sysfsutils.spec
- name: Install build deps
shell: dnf -y build-dep /tmp/sysfsutils.spec
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-basic
tests:
- smoke
required_packages:
- gcc
- sed
- make
- gawk
- autoconf
- m4