libnet/tests/sanity-tests/runtest.sh
DistroBaker 5b5050c043 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/libnet.git#b204e6ac448cf6dae450592867df49b7601c42f6
2021-01-02 21:52:16 +00:00

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