From 3aae122c4b492ff70cb3a820a0dccd6756760573 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 25 Feb 2020 14:08:10 +0100 Subject: [PATCH] Add github workflow --- .github/workflows/fedora-30.yml | 29 ++++++++++++++++++++ .github/workflows/fedora-31.yml | 29 ++++++++++++++++++++ .travis.yml | 4 +-- README.md | 2 ++ fedora-test-github.sh | 28 +++++++++++++++++++ fedora-test.sh | 36 +------------------------ test/TEST-20-NFS/test.sh | 12 +++++++-- test/TEST-30-ISCSI/test.sh | 12 +++++++-- test/TEST-31-ISCSI-MULTI/test.sh | 12 +++++++-- test/TEST-40-NBD/test.sh | 12 +++++++-- test/TEST-50-MULTINIC/test.sh | 12 +++++++-- test/TEST-60-IFCFG/server-init.sh | 2 +- test/TEST-60-IFCFG/test.sh | 14 +++++++--- test/TEST-70-BONDBRIDGETEAMVLAN/test.sh | 14 +++++++--- 14 files changed, 164 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/fedora-30.yml create mode 100644 .github/workflows/fedora-31.yml create mode 100755 fedora-test-github.sh diff --git a/.github/workflows/fedora-30.yml b/.github/workflows/fedora-30.yml new file mode 100644 index 000000000..e8c5321c5 --- /dev/null +++ b/.github/workflows/fedora-30.yml @@ -0,0 +1,29 @@ +## The test container is created with https://github.com/dracutdevs/fedora-container + +name: Fedora-30 + +on: + push: + branches: + - 'master' + tags: + - '*' + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + #container: quay.io/haraldh/dracut-fedora:30 + timeout-minutes: 30 + strategy: + matrix: + test: [ "01", "02", "03", "04", "10", "11", "12", "13", "14", "15", "17", "20", "30", "31", "40", "50", "60" ] + fail-fast: false + steps: + - name: "Checkout Repository" + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: "TEST-${{ matrix.test }}" + run: docker run --privileged -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:30 /dracut/fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} diff --git a/.github/workflows/fedora-31.yml b/.github/workflows/fedora-31.yml new file mode 100644 index 000000000..d1260f858 --- /dev/null +++ b/.github/workflows/fedora-31.yml @@ -0,0 +1,29 @@ +## The test container is created with https://github.com/dracutdevs/fedora-container + +name: Fedora-31 + +on: + push: + branches: + - 'master' + tags: + - '*' + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + #container: quay.io/haraldh/dracut-fedora:30 + timeout-minutes: 30 + strategy: + matrix: + test: [ "01", "02", "03", "04", "10", "11", "12", "13", "14", "15", "17", "20", "30", "31", "40", "50", "60" ] + fail-fast: false + steps: + - name: "Checkout Repository" + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: "TEST-${{ matrix.test }}" + run: docker run --privileged -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:31 /dracut/fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} diff --git a/.travis.yml b/.travis.yml index 40c8d1f6b..1c46062cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,8 @@ env: - IMAGE=latest TESTS=50 - IMAGE=latest TESTS=30 - IMAGE=latest TESTS=31 + - IMAGE=latest TESTS=40 - IMAGE=latest TESTS=60 - - IMAGE=latest TESTS=70 - IMAGE=latest TESTS=99 - IMAGE=latest TESTS=02 - IMAGE=latest TESTS=03 @@ -37,7 +37,7 @@ before_script: git describe --tags || : script: -- docker run --privileged -it -v $(pwd)/:/dracut fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS" +- docker run --privileged -it -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS" notifications: webhooks: diff --git a/README.md b/README.md index 418daa1d8..c0ee79e2a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ dracut dracut is an event driven initramfs infrastructure. [![Build Status](https://travis-ci.org/dracutdevs/dracut.svg?branch=master)](https://travis-ci.org/dracutdevs/dracut) +![Fedora-30](https://github.com/dracutdevs/dracut/workflows/Fedora-30/badge.svg?branch=master) +![Fedora-31](https://github.com/dracutdevs/dracut/workflows/Fedora-31/badge.svg?branch=master) dracut (the tool) is used to create an initramfs image by copying tools and files from an installed system and combining it with the diff --git a/fedora-test-github.sh b/fedora-test-github.sh new file mode 100755 index 000000000..01312e2cb --- /dev/null +++ b/fedora-test-github.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -ex + +[[ -d ${0%/*} ]] && cd ${0%/*} + +RUN_ID="$1" +TESTS=$2 + +./configure + +NCPU=$(getconf _NPROCESSORS_ONLN) + +if ! [[ $TESTS ]]; then + make -j$NCPU all syncheck rpm logtee +else + make -j$NCPU all logtee + + cd test + + time LOGTEE_TIMEOUT_MS=590000 make \ + KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \ + DRACUT_NO_XATTR=1 \ + TEST_RUN_ID=$RUN_ID \ + ${TESTS:+TESTS="$TESTS"} \ + -k V=1 \ + check +fi diff --git a/fedora-test.sh b/fedora-test.sh index 62725a325..096ed6c4b 100755 --- a/fedora-test.sh +++ b/fedora-test.sh @@ -7,41 +7,6 @@ set -ex RUN_ID="$1" TESTS=$2 -dnf -y update --best --allowerasing &>/dev/null - -dnf -y install --best --allowerasing \ - dash \ - asciidoc \ - mdadm \ - lvm2 \ - dmraid \ - cryptsetup \ - nfs-utils \ - nbd \ - dhcp-server \ - scsi-target-utils \ - iscsi-initiator-utils \ - strace \ - btrfs-progs \ - kmod-devel \ - gcc \ - bzip2 \ - xz \ - tar \ - wget \ - rpm-build \ - make \ - git \ - bash-completion \ - sudo \ - kernel \ - dhcp-client \ - /usr/bin/qemu-kvm \ - /usr/bin/qemu-system-$(uname -i) \ - e2fsprogs \ - tcpdump \ - $NULL &>/dev/null - ./configure NCPU=$(getconf _NPROCESSORS_ONLN) @@ -55,6 +20,7 @@ else time sudo LOGTEE_TIMEOUT_MS=590000 make \ KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \ + DRACUT_NO_XATTR=1 \ TEST_RUN_ID=$RUN_ID \ ${TESTS:+TESTS="$TESTS"} \ -k V=2 \ diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh index 97ee5e7b1..6334e2290 100755 --- a/test/TEST-20-NFS/test.sh +++ b/test/TEST-20-NFS/test.sh @@ -30,8 +30,16 @@ run_server() { # Cleanup the terminal if we have one tty -s && stty sane - echo Sleeping 10 seconds to give the server a head start - sleep 10 + if ! [[ $SERIAL ]]; then + echo "Waiting for the server to startup" + while : ; do + grep Serving "$TESTDIR"/server.log && break + sleep 1 + done + else + echo Sleeping 10 seconds to give the server a head start + sleep 10 + fi } client_test() { diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index e909d3730..6e3613a65 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -34,8 +34,16 @@ run_server() { # Cleanup the terminal if we have one tty -s && stty sane - echo Sleeping 20 seconds to give the server a head start - sleep 20 + if ! [[ $SERIAL ]]; then + echo "Waiting for the server to startup" + while : ; do + grep Serving "$TESTDIR"/server.log && break + sleep 1 + done + else + echo Sleeping 10 seconds to give the server a head start + sleep 10 + fi } run_client() { diff --git a/test/TEST-31-ISCSI-MULTI/test.sh b/test/TEST-31-ISCSI-MULTI/test.sh index c9df0fb39..946a198a3 100755 --- a/test/TEST-31-ISCSI-MULTI/test.sh +++ b/test/TEST-31-ISCSI-MULTI/test.sh @@ -34,8 +34,16 @@ run_server() { # Cleanup the terminal if we have one tty -s && stty sane - echo Sleeping 20 seconds to give the server a head start - sleep 20 + if ! [[ $SERIAL ]]; then + echo "Waiting for the server to startup" + while : ; do + grep Serving "$TESTDIR"/server.log && break + sleep 1 + done + else + echo Sleeping 10 seconds to give the server a head start + sleep 10 + fi } run_client() { diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh index b53992bcc..5e0793c92 100755 --- a/test/TEST-40-NBD/test.sh +++ b/test/TEST-40-NBD/test.sh @@ -35,8 +35,16 @@ run_server() { # Cleanup the terminal if we have one tty -s && stty sane - echo Sleeping 10 seconds to give the server a head start - sleep 10 + if ! [[ $SERIAL ]]; then + echo "Waiting for the server to startup" + while : ; do + grep Serving "$TESTDIR"/server.log && break + sleep 1 + done + else + echo Sleeping 10 seconds to give the server a head start + sleep 10 + fi } client_test() { diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh index 22739071c..dfddfbd7d 100755 --- a/test/TEST-50-MULTINIC/test.sh +++ b/test/TEST-50-MULTINIC/test.sh @@ -32,8 +32,16 @@ run_server() { # Cleanup the terminal if we have one tty -s && stty sane - echo Sleeping 10 seconds to give the server a head start - sleep 10 + if ! [[ $SERIAL ]]; then + echo "Waiting for the server to startup" + while : ; do + grep Serving "$TESTDIR"/server.log && break + sleep 1 + done + else + echo Sleeping 10 seconds to give the server a head start + sleep 10 + fi } client_test() { diff --git a/test/TEST-60-IFCFG/server-init.sh b/test/TEST-60-IFCFG/server-init.sh index 7aae0f139..cff29a3bf 100755 --- a/test/TEST-60-IFCFG/server-init.sh +++ b/test/TEST-60-IFCFG/server-init.sh @@ -116,7 +116,7 @@ dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases ens3 ens5 #sh -i #tcpdump -i ens3 # Wait forever for the VM to die -echo "Serving NFS mounts" +echo "Serving" while :; do sleep 10 >/dev/watchdog diff --git a/test/TEST-60-IFCFG/test.sh b/test/TEST-60-IFCFG/test.sh index a766443bd..59dc9475f 100755 --- a/test/TEST-60-IFCFG/test.sh +++ b/test/TEST-60-IFCFG/test.sh @@ -39,8 +39,16 @@ run_server() { # Cleanup the terminal if we have one tty -s && stty sane - echo Sleeping 10 seconds to give the server a head start - sleep 10 + if ! [[ $SERIAL ]]; then + echo "Waiting for the server to startup" + while : ; do + grep Serving "$TESTDIR"/server.log && break + sleep 1 + done + else + echo Sleeping 10 seconds to give the server a head start + sleep 10 + fi } client_test() { @@ -99,7 +107,7 @@ client_test() { -initrd "$TESTDIR"/initramfs.testing fi - { + { read OK if [[ "$OK" != "OK" ]]; then echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh b/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh index 5cb887822..f121d5b57 100755 --- a/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh +++ b/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh @@ -39,8 +39,16 @@ run_server() { # Cleanup the terminal if we have one tty -s && stty sane - echo Sleeping 10 seconds to give the server a head start - sleep 10 + if ! [[ $SERIAL ]]; then + echo "Waiting for the server to startup" + while : ; do + grep Serving "$TESTDIR"/server.log && break + sleep 1 + done + else + echo Sleeping 10 seconds to give the server a head start + sleep 10 + fi } client_test() { @@ -99,7 +107,7 @@ client_test() { -initrd "$TESTDIR"/initramfs.testing fi - { + { read OK if [[ "$OK" != "OK" ]]; then echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" -- 2.39.2