Skip to content

MalloZup/spacewalk-tests

 
 

Repository files navigation

spacewalk-tests

Tests for Spacewalk. Let's do open source tests for open source software!

Creating VM to run the tests

To create testing envroment just create following script as root. Script creates KVM guest with Fedora OS on your system so tests can run in oredefined environment and would not disturb your workstation setup. It is possible to define version of Fedora for installation by use variable "$release".

# default version of Fedora is set 24
# export release=23
sudo ./create-kvm-guest.sh

Resulting guest fedora-spacewalk should have 2GB RAM, its IP should be in config/hosts.ini, roots password should be spacewalk and system should have config/id_rsa.pub in /root/.ssh/authorized_keys (private key is config/id_rsa).

How the Beaker test looks like

Example how to test looks[1]:

# cat runtest.sh
#!/bin/bash
# Include Beaker environment
. /usr/bin/rhts-environment.sh || exit 1
. /usr/share/beakerlib/beakerlib.sh || exit 1

rlJournalStart
    rlPhaseStartTest
        rlRun "cat /proc/filesystems | grep 'ext4'" 0 "Check if ext4 is supported"
    rlPhaseEnd
rlJournalPrintText
rlJournalEnd

For an example test see Spacewalk/Others/Example directory. To run the test, you can:

make -C Spacewalk/Others/Example

Running tests in the VM

Directly via ssh

TODO: Install test's requirements before running it.

ssh -i config/id_rsa root@$( cat config/hosts.ini ) -C "make run -C /mnt/tests/CoreOS/Spacewalk/Others/Example"

Via Ansible

If you have Ansible installed, you can run:

ansible-playbook --private-key config/id_rsa -i config/hosts.ini tests.yaml --extra-vars="test=/CoreOS/Spacewalk/Others/Example"

Via Fabfric

Or if you like use Fabric and it is isntalled, you can run:

fab run_test:test_name=/CoreOS/Spacewalk/Others/Example"

[1] https://beaker-project.org/docs/user-guide/example-task.html

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 52.2%
  • Shell 40.8%
  • Makefile 7.0%