justification Adds tests according to the CI wiki specifically the standard test interface in the spec. The playbook includes Tier1 level test cases that have been tested in the following contexts and is passing reliably: Classic. Test logs are stored in the artifacts directory. The following steps are used to execute the tests using the standard test interface: Test enveronment Make sure you have installed packages from the spec ``` ansible-2.4.1.0-2.fc28.noarch python2-dnf-2.7.5-1.fc28.noarch libselinux-python-2.7-2.fc28.x86_64 standard-test-roles-2.5-1.fc28.noarch ``` Run tests for Classic Snip of the example test run for Classic tests: ``` :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Test :: Test :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ 17:42:55 ] :: [ LOG ] :: Starting libnet tests ... :: [ 17:42:55 ] :: [ LOG ] :: Starting libnet tests ... :: [ 17:42:55 ] :: [ BEGIN ] :: Running '/usr/bin/test-libnet' [==========] Running 2 test(s). [ RUN ] test_udp_packet_ipv4 UDP src_port=2425 dst_port=2426 UDP src_port=2425 dst_port=2426 UDP src_port=2425 dst_port=2426 UDP src_port=2425 dst_port=2426 [ OK ] test_udp_packet_ipv4 [ RUN ] test_tcp_packet_ipv4 TCP src_port=2425 dst_port=2426 TCP src_port=2425 dst_port=2426 TCP src_port=2425 dst_port=2426 TCP src_port=2425 dst_port=2426 [ OK ] test_tcp_packet_ipv4 [==========] 2 test(s) run. [ PASSED ] 2 test(s). :: [ 17:43:05 ] :: [ PASS ] :: Command '/usr/bin/test-libnet' (Expected 0, got 0) :: [ 17:43:05 ] :: [ PASS ] :: Command '/usr/bin/test-libnet' (Expected 0, got 0) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Duration: 10s :: Duration: 10s :: Assertions: 1 good, 0 bad :: Assertions: 1 good, 0 bad :: RESULT: PASS :: RESULT: PASS ```
45 lines
1.1 KiB
Bash
Executable File
45 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# SPDX-License-Identifier: LGPL-2.1+
|
|
# ~~~
|
|
# runtest.sh of libnet
|
|
# Description: Tests for libnet
|
|
#
|
|
# Author: Susant Sahani <susant@redhat.com>
|
|
# Copyright (c) 2018 Red Hat, Inc.
|
|
# ~~~
|
|
|
|
# Include Beaker environment
|
|
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
|
|
|
PACKAGE="libnet"
|
|
|
|
rlJournalStart
|
|
rlPhaseStartSetup
|
|
rlAssertRpm $PACKAGE
|
|
|
|
rlLog "Setting up veth Interface "
|
|
rlRun "ip link add veth-test type veth peer name veth-peer"
|
|
rlRun "ip addr add 192.168.50.5 dev veth-test"
|
|
rlRun "ip addr add 192.168.50.6 dev veth-peer"
|
|
rlRun "ip link set dev veth-test up"
|
|
rlRun "ip link set dev veth-peer up"
|
|
|
|
rlRun "cp test-libnet /usr/bin/"
|
|
rlRun "systemctl daemon-reload"
|
|
rlPhaseEnd
|
|
|
|
rlPhaseStartTest
|
|
rlLog "Starting libnet tests ..."
|
|
rlRun "/usr/bin/test-libnet"
|
|
rlPhaseEnd
|
|
|
|
rlPhaseStartCleanup
|
|
rlRun "rm /usr/bin/test-libnet"
|
|
rlRun "ip link del veth-test"
|
|
rlLog "libnet tests done"
|
|
rlPhaseEnd
|
|
rlJournalPrintText
|
|
rlJournalEnd
|
|
|
|
rlGetTestState
|