add ci testsuite
This commit is contained in:
parent
f0713785a2
commit
cb7acaa016
2 changed files with 104 additions and 0 deletions
34
Sanity/CI-upstream-tests/main.fmf
Normal file
34
Sanity/CI-upstream-tests/main.fmf
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
summary: System tests, which are intended to be used in CI
|
||||
description: ''
|
||||
component:
|
||||
- chrony
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- chrony
|
||||
- gnutls-utils
|
||||
- linuxptp
|
||||
duration: 15m
|
||||
enabled: true
|
||||
tag:
|
||||
- NoRHEL4
|
||||
- NoRHEL5
|
||||
- NoRHEL6
|
||||
- NoRHEL7
|
||||
- TIPfail_infra
|
||||
- TIPfail_samba
|
||||
- TIPfail_systemd
|
||||
- TIPpass
|
||||
- Tier1
|
||||
- notier
|
||||
tier: '1'
|
||||
adjust:
|
||||
- enabled: false
|
||||
when: distro == rhel-4, rhel-5, rhel-6, rhel-7, rhel-alt-7
|
||||
continue: false
|
||||
- enabled: false
|
||||
when: distro == f-29
|
||||
continue: false
|
||||
extra-nitrate: TC#0600627
|
||||
extra-summary: /CoreOS/chrony/Sanity/CI-upstream-tests
|
||||
extra-task: /CoreOS/chrony/Sanity/CI-upstream-tests
|
||||
70
Sanity/CI-upstream-tests/runtest.sh
Executable file
70
Sanity/CI-upstream-tests/runtest.sh
Executable file
|
|
@ -0,0 +1,70 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /CoreOS/chrony/Sanity/CI-upstream-tests
|
||||
# Description: "system" tests, which are intended to be used in CI
|
||||
# Author: Ondrej Mejzlik <omejzlik@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2019 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# If the daemon can not be contacted, try setenforce 0, then it is a selinux problem
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE=${PACKAGE:-chrony}
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE || rlDie "Package $PACKAGE not installed"
|
||||
rlLog "Stopping chronyd"
|
||||
rlServiceStop "chronyd"
|
||||
TESTDIR=$(pwd)
|
||||
DEFAULT_IF="$(ip route show | grep default | sed 's/.* dev \([^ ]\+\) .*/\1/' | head -n 1)"
|
||||
rlLog "PC name: $(hostname), $(hostname -A) User: $(whoami) DefaultIF: $DEFAULT_IF"
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "chmod ugo+rx $TmpDir" 0 "Let all read the test tmp directory"
|
||||
rlRun "pushd $TmpDir" 0 "Going into tmp directory $TmpDir"
|
||||
#rlRun "git clone https://git.tuxfamily.org/chrony/chrony.git"
|
||||
rlRun "rlFetchSrcForInstalled chrony" 0 "Get chrony src.rpm"
|
||||
rlRun "rpm2cpio chrony-* | cpio -idm" 0 "Extract chrony src.rpm"
|
||||
rlRun "tar xf chrony*.gz" 0 "Extract test folder"
|
||||
rlRun "cd ./chrony-*/test/system" 0 "Go into test directory"
|
||||
rlRun "chcon -R system_u:object_r:chronyd_var_run_t:s0 ." 0 "Set SELinux context"
|
||||
rlPhaseEnd
|
||||
|
||||
rlGetTestState && {
|
||||
rlPhaseStartTest
|
||||
rlRun -s "./run -d" 0 "Run all tests"
|
||||
rlRun "grep 'FAILED 0' $rlRun_LOG" 0 "No test failed"
|
||||
rlPhaseEnd
|
||||
}
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "cd -"
|
||||
INTERFACES="$(grep : /proc/net/dev | grep -o '^[^:]*' | tr '\n' ' ')"
|
||||
rlRun "for i in $INTERFACES; do hwstamp_ctl -i $i -r 0 -t 0; done 2> /dev/null || :" 0 "Disable HW timestamping"
|
||||
rlLog "Restoring original chronyd state"
|
||||
rlServiceRestore "chronyd"
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
Loading…
Add table
Add a link
Reference in a new issue