Skip to content

Commit 13b4286

Browse files
authored
Merge pull request #1210 from c-po/add-image-smoketest
Testsuite: T8602: add QEMU smoketest for add-system-image over HTTP (default + VRF)
2 parents 8669f15 + 2c5c8a4 commit 13b4286

5 files changed

Lines changed: 297 additions & 87 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ packer_build/*
66
packer_cache/*
77
key/*
88
packages/*
9+
rootfs/*
910
!packages/*/
1011
/testinstall*.raw
1112
/testinstall*.efivars
1213
/ci_data
1314
/ci_seed.iso
15+
/nested_installer_payload.iso
1416
/*.qcow2
1517
/*.tar
1618
.DS_Store

Makefile

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,62 +12,54 @@ all:
1212
%:
1313
./build-vyos-image $*
1414

15-
.PHONY: checkiso
16-
.ONESHELL:
17-
checkiso:
18-
if [[ ! -f $(ISO_PATH) ]]; then
19-
echo "Could not find $(ISO_PATH)"
20-
exit 1
21-
fi
22-
2315
.PHONY: test
2416
.ONESHELL:
25-
test: checkiso
26-
scripts/check-qemu-install --debug --configd --match="$(MATCH)" --smoketest --uefi --cpu 4 --memory 8 --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
17+
test:
18+
scripts/check-qemu-install --debug --match="$(MATCH)" --smoketest --uefi --cpu 4 --memory 8 --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
2719

2820
.PHONY: test-no-interfaces
2921
.ONESHELL:
30-
test-no-interfaces: checkiso
31-
scripts/check-qemu-install --debug --configd --smoketest --uefi --no-interfaces --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --isolate-cpus 2-3 --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
22+
test-no-interfaces:
23+
scripts/check-qemu-install --debug --smoketest --uefi --no-interfaces --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --isolate-cpus 2-3 --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
3224

3325
.PHONY: test-no-interfaces-no-vpp
3426
.ONESHELL:
35-
test-no-interfaces-no-vpp: checkiso
36-
scripts/check-qemu-install --debug --configd --smoketest --uefi --no-interfaces --no-vpp --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
27+
test-no-interfaces-no-vpp:
28+
scripts/check-qemu-install --debug --smoketest --uefi --no-interfaces --no-vpp --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
3729

3830
.PHONY: test-interfaces
3931
.ONESHELL:
40-
test-interfaces: checkiso
41-
scripts/check-qemu-install --debug --configd --match="interfaces_" --smoketest --uefi --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
32+
test-interfaces:
33+
scripts/check-qemu-install --debug --match="interfaces_" --smoketest --uefi --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
4234

4335
.PHONY: test-vpp
4436
.ONESHELL:
45-
test-vpp: checkiso
46-
scripts/check-qemu-install --debug --configd --match="vpp" --smoketest --uefi --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --isolate-cpus 2-3 --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
37+
test-vpp:
38+
scripts/check-qemu-install --debug --match="vpp" --smoketest --uefi --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --isolate-cpus 2-3 --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
4739

4840
.PHONY: testc
4941
.ONESHELL:
50-
testc: checkiso
51-
scripts/check-qemu-install --debug --configd --match="!vpp" --cpu 2 --memory 7 --configtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
42+
testc:
43+
scripts/check-qemu-install --debug --match="!vpp" --cpu 2 --memory 7 --configtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
5244

5345
.PHONY: testcvpp
5446
.ONESHELL:
55-
testcvpp: checkiso
56-
scripts/check-qemu-install --debug --configd --match="vpp" --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --isolate-cpus 2-3 --configtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
47+
testcvpp:
48+
scripts/check-qemu-install --debug --match="vpp" --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --isolate-cpus 2-3 --configtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
5749

5850
.PHONY: testraid
5951
.ONESHELL:
60-
testraid: checkiso
61-
scripts/check-qemu-install --debug --configd --raid --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
52+
testraid:
53+
scripts/check-qemu-install --debug --raid --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
6254

6355
.PHONY: testsb
6456
.ONESHELL:
65-
testsb: checkiso
57+
testsb:
6658
scripts/check-qemu-install --debug --uefi --sbtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
6759

6860
.PHONY: testtpm
6961
.ONESHELL:
70-
testtpm: checkiso
62+
testtpm:
7163
scripts/check-qemu-install --debug --tpmtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
7264

7365
.PHONY: test-ci-qcow2
@@ -80,15 +72,20 @@ test-ci-qcow2:
8072
rm -f cloud-init-image-$(ARCH).qcow2 ; cp $$(ls -t build/*.qcow2 | head -n 1) cloud-init-image-$(ARCH).qcow2
8173
scripts/check-qemu-install --debug --cloud-init --disk cloud-init-image-$(ARCH).qcow2 $(filter-out $@,$(MAKECMDGOALS))
8274

75+
.PHONY: test-image-update
76+
.ONESHELL:
77+
test-image-update:
78+
scripts/check-qemu-install --debug --test-image-update --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
79+
8380
.PHONY: qemu-live
8481
.ONESHELL:
85-
qemu-live: checkiso
82+
qemu-live:
8683
scripts/check-qemu-install --qemu-cmd --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS))
8784

8885
.PHONY: oci
8986
.ONESHELL:
90-
oci: checkiso
91-
scripts/iso-to-oci $(ISO_PATH)
87+
oci:
88+
@scripts/iso-to-oci $(ISO_PATH)
9289

9390
.PHONY: clean
9491
.ONESHELL:
@@ -113,7 +110,7 @@ clean:
113110

114111
.PHONY: purge
115112
purge:
116-
rm -rf build packer_build packer_cache testinstall-*.raw ci_data ci_seed.iso
113+
rm -rf build packer_build packer_cache testinstall-*.raw ci_data ci_seed.iso nested_iso_data nested_installer_payload.iso
117114

118115
.PHONY: ansible-install ansible-check ansible-clean
119116
.ONESHELL:

docker/Dockerfile

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Must be run with --privileged flag, recommended to run the container with a
1717
# volume mapped in order to easy export images
1818

19-
# This Dockerfile is installable on both x86, x86-64, armhf and arm64 systems
19+
# This Dockerfile is installable on x86-64 (amd64) and aarch64 (amd64) systems
2020
ARG ARCH=
2121
FROM ${ARCH}debian:bookworm-slim
2222

@@ -27,14 +27,10 @@ RUN grep "VERSION_ID" /etc/os-release || (echo 'VERSION_ID="12"' >> /etc/os-rele
2727

2828
# To install using a non-native cpu instructionset use the `--build-arg ARCH=<ARCH>/`
2929
# Supported architectures:
30-
# arm32v6/
31-
# arm32v7/
3230
# arm64v8/
33-
# Example bo byukd natively:
31+
# Example to build natively:
3432
# docker build -t vyos-build:rolling .
35-
# Example to build on armhf:
36-
# docker build -t vyos-build:rolling-armhf --build-arg ARCH=arm32v7/ .
37-
# Example to build on arm64:
33+
# Example to build on arm64/aarch64:
3834
# docker build -t vyos-build:rolling-arm64 --build-arg ARCH=arm64v8/ .
3935

4036
# On some versions of docker the emulation framework is not installed by default and
@@ -45,7 +41,7 @@ LABEL authors="VyOS Maintainers <maintainers@vyos.io>" \
4541
org.opencontainers.image.url="https://github.com/vyos/vyos-build" \
4642
org.opencontainers.image.documentation="https://docs.vyos.io/en/latest/contributing/build-vyos.html" \
4743
org.opencontainers.image.source="https://github.com/vyos/vyos-build" \
48-
org.opencontainers.image.vendor="Sentrium S.L." \
44+
org.opencontainers.image.vendor="VyOS Networks" \
4945
org.opencontainers.image.licenses="GNU" \
5046
org.opencontainers.image.title="vyos-build" \
5147
org.opencontainers.image.description="Container to build VyOS ISO" \
@@ -134,13 +130,6 @@ RUN apt-get update && apt-get install -y \
134130
libpcre2-dev \
135131
unzip
136132

137-
# Update certificate store to not crash ocaml package install
138-
# Apply fix for https in curl running on armhf
139-
RUN dpkg-reconfigure ca-certificates; \
140-
if dpkg-architecture -iarmhf; then \
141-
echo "cacert=/etc/ssl/certs/ca-certificates.crt" >> ~/.curlrc; \
142-
fi
143-
144133
# Installing OCaml needed to compile libvyosconfig
145134
RUN curl https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh \
146135
--output /tmp/opam_install.sh --retry 10 --retry-delay 5 && \
@@ -187,7 +176,6 @@ RUN git clone https://salsa.debian.org/live-team/live-build.git /tmp/live-build
187176
dpkg -i ../live-build*.deb && \
188177
rm -rf /tmp/live-build
189178

190-
#
191179
# live-build: building in docker fails with mounting /proc | /sys
192180
#
193181
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=919659
@@ -265,29 +253,28 @@ RUN GO_VERSION_INSTALL="1.23.2" ; \
265253
rm /tmp/go*.tar.gz
266254
RUN echo "export PATH=/opt/go/bin:$PATH" >> /etc/bash.bashrc
267255

268-
# Packages needed for Qemu test-suite
269-
# Packages for i386 and amd64 platforms
270-
RUN if dpkg-architecture -ii386 || dpkg-architecture -iamd64; then \
271-
apt-get update && apt-get install -y \
256+
# Packages needed for QEMU test-suite
257+
RUN apt-get update && apt-get install -y \
272258
python3-pexpect \
273-
ovmf \
274-
qemu-system-x86 \
275259
qemu-utils \
276-
qemu-kvm; \
260+
qemu-kvm
261+
262+
# Packages for amd64 platforms
263+
RUN if dpkg-architecture -iamd64; then \
264+
apt-get update && apt-get install -y \
265+
ovmf \
266+
qemu-system-x86; \
277267
fi
278268

279269
# Packages for arm64 platform
280270
RUN if dpkg-architecture -iarm64; then \
281271
apt-get update && apt-get install -y \
282-
python3-pexpect \
283-
ipxe-qemu \
284272
qemu-system-aarch64 \
285273
qemu-efi-aarch64; \
286274
fi
287275

288-
# Packages needed for building vmware and GCE images
289-
# This is only supported on i386 and amd64 platforms
290-
RUN if dpkg-architecture -ii386 || dpkg-architecture -iamd64; then \
276+
# Packages needed for building VMware and GCE images
277+
RUN if dpkg-architecture -iamd64; then \
291278
apt-get update && apt-get install -y \
292279
parted \
293280
udev \
@@ -318,11 +305,6 @@ RUN if dpkg-architecture -iarm64; then \
318305
dosfstools \
319306
u-boot-tools \
320307
grub-efi-$(dpkg-architecture -qDEB_HOST_ARCH); \
321-
elif dpkg-architecture -iarmhf; then \
322-
apt-get update && apt-get install -y \
323-
dosfstools \
324-
u-boot-tools \
325-
grub-efi-arm; \
326308
fi
327309

328310
# Packages needed for OWAMP/TWAMP (service sla)

0 commit comments

Comments
 (0)