mirror of
https://github.com/linux-system-roles/network.git
synced 2026-08-02 15:52:40 +00:00
ci: fix and improve integration container testing
Use the vault for centos 7 and centos stream 8 Exclude tests/tests_team_plugin_installation_nm.yml since tests/tests_team_nm.yml is excluded. Use grouping to group log lines for better readability. https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#grouping-log-lines Signed-off-by: Rich Megginson <rmeggins@redhat.com>
This commit is contained in:
parent
931cdb335d
commit
89d7148e81
3 changed files with 19 additions and 2 deletions
3
.github/Dockerfile.c7-network-role
vendored
3
.github/Dockerfile.c7-network-role
vendored
|
|
@ -1,6 +1,7 @@
|
|||
FROM quay.io/centos/centos:centos7
|
||||
|
||||
RUN yum -y install epel-release && \
|
||||
RUN yum -y install https://dl.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm && \
|
||||
sed -i '/^mirror/d;s/#\?\(baseurl=http:\/\/\)mirror/\1vault/' /etc/yum.repos.d/*.repo && \
|
||||
yum -y upgrade && \
|
||||
yum -y install NetworkManager NetworkManager-wifi \
|
||||
procps-ng iproute ansible openssh-server openssh-clients \
|
||||
|
|
|
|||
3
.github/Dockerfile.c8s-network-role
vendored
3
.github/Dockerfile.c8s-network-role
vendored
|
|
@ -1,6 +1,7 @@
|
|||
FROM quay.io/centos/centos:stream8
|
||||
|
||||
RUN dnf -y install dnf-plugins-core epel-release && \
|
||||
RUN sed -i '/^mirror/d;s/#\(baseurl=http:\/\/\)mirror/\1vault/' /etc/yum.repos.d/*.repo && \
|
||||
dnf -y install dnf-plugins-core epel-release && \
|
||||
dnf config-manager --set-enabled powertools && \
|
||||
dnf -y upgrade && \
|
||||
dnf -y install NetworkManager NetworkManager-wifi \
|
||||
|
|
|
|||
15
.github/run_test.sh
vendored
15
.github/run_test.sh
vendored
|
|
@ -20,6 +20,7 @@ EXCLUDE_TESTS_C7='
|
|||
-e tests/tests_bond_removal_initscripts.yml
|
||||
-e tests/tests_infiniband_nm.yml
|
||||
-e tests/tests_team_nm.yml
|
||||
-e tests/tests_team_plugin_installation_nm.yml
|
||||
-e tests/tests_unit.yml
|
||||
-e tests/tests_wireless_nm.yml
|
||||
'
|
||||
|
|
@ -37,6 +38,7 @@ EXCLUDE_TESTS_C8S='
|
|||
-e tests/tests_infiniband_nm.yml
|
||||
-e tests/tests_integration_pytest.yml
|
||||
-e tests/tests_team_nm.yml
|
||||
-e tests/tests_team_plugin_installation_nm.yml
|
||||
-e tests/tests_unit.yml
|
||||
-e tests/tests_wireless_wpa3_owe_nm.yml
|
||||
-e tests/tests_wireless_wpa3_sae_nm.yml
|
||||
|
|
@ -52,6 +54,7 @@ EXCLUDE_TESTS_C9S='
|
|||
-e tests/tests_provider_nm.yml
|
||||
-e tests/tests_regression_nm.yml
|
||||
-e tests/tests_team_nm.yml
|
||||
-e tests/tests_team_plugin_installation_nm.yml
|
||||
-e tests/tests_unit.yml
|
||||
-e tests/tests_wireless_wpa3_owe_nm.yml
|
||||
-e tests/tests_wireless_wpa3_sae_nm.yml
|
||||
|
|
@ -107,6 +110,8 @@ EOF
|
|||
;;
|
||||
esac
|
||||
|
||||
echo "::group::Start test container"
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
CONTAINER_ID=$(podman run -d $PODMAN_OPTS \
|
||||
-v "$PROJECT_PATH":$TEST_SOURCE_DIR $CONTAINER_IMAGE)
|
||||
|
|
@ -116,6 +121,8 @@ if [ -z "$CONTAINER_ID" ];then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo ::endgroup::
|
||||
|
||||
function clean_up {
|
||||
podman rm -f "$CONTAINER_ID" || true
|
||||
}
|
||||
|
|
@ -124,6 +131,8 @@ if [ -z "${DEBUG:-}" ];then
|
|||
trap clean_up ERR EXIT
|
||||
fi
|
||||
|
||||
echo "::group::Set up container for testing"
|
||||
|
||||
# Ensure we are testing the latest packages and ignore upgrade failure
|
||||
sudo podman exec -i "$CONTAINER_ID" /bin/bash -c 'dnf upgrade -y' || true
|
||||
|
||||
|
|
@ -163,16 +172,22 @@ for req in meta/collection-requirements.yml tests/collection-requirements.yml; d
|
|||
fi"
|
||||
done
|
||||
|
||||
echo ::endgroup::
|
||||
|
||||
for test_file in $TEST_FILES; do
|
||||
echo "::group::Test $test_file"
|
||||
podman exec -i "$CONTAINER_ID" \
|
||||
/bin/bash -c \
|
||||
"cd $TEST_SOURCE_DIR;
|
||||
env ANSIBLE_HOST_KEY_CHECKING=False \
|
||||
ansible-playbook -i localhost, \
|
||||
$test_file"
|
||||
echo ::endgroup::
|
||||
done
|
||||
|
||||
if [ -n "${DEBUG:-}" ];then
|
||||
echo "::group::Cleanup"
|
||||
podman exec -it "$CONTAINER_ID" bash
|
||||
clean_up
|
||||
echo ::endgroup::
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue