ci: integration: Extract the integration CI main recipe to jobs.sh

Follow what's been done to other jobs in .gitlab-ci.yml and extract the
shell logic from YAML to a function in ci/jobs.sh

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Erik Skultety 2023-09-15 14:23:21 +02:00
parent c222e37264
commit 6e9bd600d7
2 changed files with 34 additions and 34 deletions

View File

@ -27,33 +27,6 @@
.install-deps: &install-deps .install-deps: &install-deps
- sudo dnf install -y libvirt-rpms/* libvirt-perl-rpms/* libvirt-python-rpms/* - sudo dnf install -y libvirt-rpms/* libvirt-perl-rpms/* libvirt-python-rpms/*
# Avocado >98.0 fails with the nwfilter TCK tests, so stick with 98.0 for now
- sudo pip3 install --prefix=/usr avocado-framework
.enable-core-dumps: &enable-core-dumps
- sudo sh -c "echo DefaultLimitCORE=infinity >> /etc/systemd/system.conf" # Explicitly allow storing cores globally
- sudo systemctl daemon-reexec # need to reexec systemd after changing config
.enable-libvirt-debugging: &enable-libvirt-debugging
- source /etc/os-release # in order to query the vendor-provided variables
- if test "$ID" = "centos" && test "$VERSION_ID" -lt 9;
then
DAEMONS="libvirtd virtlockd virtlogd";
else
DAEMONS="virtinterfaced virtlockd virtlogd virtnetworkd virtnodedevd virtnwfilterd virtproxyd virtqemud virtsecretd virtstoraged";
fi
- for daemon in $DAEMONS;
do
LOG_OUTPUTS="1:file:/var/log/libvirt/${daemon}.log";
LOG_FILTERS="3:remote 4:event 3:util.json 3:util.object 3:util.dbus 3:util.netlink 3:node_device 3:rpc 3:access 1:*";
sudo augtool set /files/etc/libvirt/${daemon}.conf/log_filters "'$LOG_FILTERS'" &>/dev/null;
sudo augtool set /files/etc/libvirt/${daemon}.conf/log_outputs "'$LOG_OUTPUTS'" &>/dev/null;
sudo systemctl --quiet stop ${daemon}.service;
sudo systemctl restart ${daemon}.socket;
done
.collect-logs: &collect-logs .collect-logs: &collect-logs
- set +e - set +e
@ -78,14 +51,9 @@
before_script: before_script:
- mkdir "$SCRATCH_DIR" - mkdir "$SCRATCH_DIR"
- *install-deps - *install-deps
- *enable-core-dumps
- *enable-libvirt-debugging
- sudo virsh net-start default &>/dev/null || true;
script: script:
- cd "$SCRATCH_DIR" - source ci/jobs.sh
- git clone --depth 1 https://gitlab.com/libvirt/libvirt-tck.git - run_integration
- cd libvirt-tck
- sudo avocado --config avocado.config run --job-results-dir "$SCRATCH_DIR"/avocado
after_script: after_script:
- test "$CI_JOB_STATUS" = "success" && exit 0; - test "$CI_JOB_STATUS" = "success" && exit 0;
- *collect-logs - *collect-logs

View File

@ -80,3 +80,35 @@ run_website_build() {
run_build run_build
} }
run_integration() {
# Avocado >98.0 fails with the nwfilter TCK tests, so stick with 98.0 for now
sudo pip3 install --prefix=/usr avocado-framework
sudo sh -c "echo DefaultLimitCORE=infinity >> /etc/systemd/system.conf" # Explicitly allow storing cores globally
sudo systemctl daemon-reexec # need to reexec systemd after changing config
source /etc/os-release # in order to query the vendor-provided variables
if test "$ID" = "centos" && test "$VERSION_ID" -lt 9
then
DAEMONS="libvirtd virtlockd virtlogd"
else
DAEMONS="virtinterfaced virtlockd virtlogd virtnetworkd virtnodedevd virtnwfilterd virtproxyd virtqemud virtsecretd virtstoraged"
fi
for daemon in $DAEMONS
do
LOG_OUTPUTS="1:file:/var/log/libvirt/${daemon}.log"
LOG_FILTERS="3:remote 4:event 3:util.json 3:util.object 3:util.dbus 3:util.netlink 3:node_device 3:rpc 3:access 1:*"
sudo augtool set /files/etc/libvirt/${daemon}.conf/log_filters "'$LOG_FILTERS'" &>/dev/null
sudo augtool set /files/etc/libvirt/${daemon}.conf/log_outputs "'$LOG_OUTPUTS'" &>/dev/null
sudo systemctl --quiet stop ${daemon}.service
sudo systemctl restart ${daemon}.socket
done
sudo virsh net-start default &>/dev/null || true
cd "$SCRATCH_DIR"
git clone --depth 1 https://gitlab.com/libvirt/libvirt-tck.git
cd libvirt-tck
sudo avocado --config avocado.config run --job-results-dir "$SCRATCH_DIR"/avocado
}