Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 9 additions & 35 deletions tests/ci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ KLDFILEMONISLOADED!=kldload -q -n filemon 2>/dev/null && echo "1" || echo "0"
METAMODE?=-DWITH_META_MODE
.endif

CLEANFILES+= ${.OBJDIR}/${CIIMAGE} ${.OBJDIR}/ci.img ${META_TAR}
CLEANFILES+= ${CIDISK} ${.OBJDIR}/ci.img ${META_TAR}
IMAGEDIR= ${.OBJDIR}/ci-buildimage
CLEANDIRS+= ${IMAGEDIR}

Expand All @@ -151,7 +151,7 @@ portinstall-pkg: .PHONY
.endif

portinstall-qemu: portinstall-pkg .PHONY
.if !exists(/usr/local/bin/qemu-${QEMU_ARCH}-static)
.if !empty(QEMUSTATIC) && !exists(${QEMUSTATIC})
env ASSUME_ALWAYS_YES=yes pkg install emulators/qemu-user-static
.endif
.if !exists(${QEMUBIN})
Expand Down Expand Up @@ -192,45 +192,24 @@ ci-buildimage: ${QEMUTGT} ci-buildkernel-${TARGET_ARCH:tl} .PHONY
${RELEASEDIR}/scripts/mk-vmimage.sh \
-C ${RELEASEDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} -F ${VMFS} \
-i ${.OBJDIR}/ci.img -s ${VMSIZE} -f ${FORMAT} \
-S ${WORLDDIR} -o ${.OBJDIR}/${CIIMAGE} -c ${CICONF} ${LOG_TARGET}
-S ${WORLDDIR} -o ${CIDISK} -c ${CICONF} ${LOG_TARGET}
touch ${.TARGET}

ci-set-smoke-var: .PHONY
CITYPE=smoke

ci-set-full-var: .PHONY
CITYPE=full

ci-create-meta: .PHONY
truncate -s 512M ${META_TAR}
tar rvf ${META_TAR} -C ${META_DIR} .

ci-extract-meta: .PHONY
.if ${CITYPE:tl} == "full"
tar xfv ${META_TAR} -C ${META_DIROUT}
rm -rf ${META_TAR} ${META_DIR}
chmod 0755 ${META_DIROUT}
@echo "Extracted kyua reports to ${META_DIROUT}"
.else
rm -rf ${META_TAR} ${META_DIR} ${META_DIROUT}
.endif

ci-runtest: ci-buildimage-${TARGET_ARCH:tl} portinstall .PHONY
.if ${MACHINE} == "amd64" && ( ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" ) && ( !defined(USE_QEMU) || empty(USE_QEMU) )
/usr/sbin/bhyvectl --vm=${TEST_VM_NAME} --destroy || true
expect -c "set timeout ${TIMEOUT_EXPECT}; \
spawn /usr/bin/timeout -k 5s 30s /usr/sbin/bhyveload \
-c stdio -m ${VM_MEM_SIZE} -d ${CIDISK} ${TEST_VM_NAME}; \
expect { eof }; \
exit [lindex [wait] 3]"
expect -c "set timeout ${TIMEOUT_EXPECT}; \
spawn /usr/bin/timeout -k 60 ${TIMEOUT_VM} /usr/sbin/bhyve \
-c ${PARALLEL_JOBS} -m ${VM_MEM_SIZE} -A -H -P \
-s 0:0,hostbridge \
-s 1:0,lpc \
-s 2:0,virtio-blk,${CIDISK} \
-s 3:0,virtio-blk,${META_TAR} \
${BHYVE_EXTRA_DISK_PARAM} \
-l com1,stdio \
${TEST_VM_NAME}; \
expect { eof }"
/usr/sbin/bhyvectl --vm=${TEST_VM_NAME} --destroy
.else
timeout -k 60 ${TIMEOUT_VM} ${QEMUBIN} \
-machine ${QEMU_MACHINE} \
-smp ${QEMU_CPU_COUNT} \
Expand All @@ -243,7 +222,6 @@ ci-runtest: ci-buildimage-${TARGET_ARCH:tl} portinstall .PHONY
-blockdev driver=raw,node-name=hd0,file.driver=file,file.filename=${CIDISK} \
-blockdev driver=raw,node-name=hd1,file.driver=file,file.filename=${META_TAR} \
${QEMU_DEVICES}
.endif

ci-checktarget: .PHONY
.if ${TARGET_ARCH} != "aarch64" && \
Expand All @@ -257,10 +235,6 @@ ci-checktarget: .PHONY
@echo "Error: ${TARGET_ARCH} is not supported on ${TYPE} ${REVISION} ${BRANCH}"
.endif

ci-smoke: ci-set-smoke-var ci-create-meta ci-checktarget .WAIT ci-runtest-${TARGET_ARCH:tl} .PHONY

ci-full: ci-set-full-var ci-create-meta ci-checktarget .WAIT ci-runtest-${TARGET_ARCH:tl} .WAIT ci-extract-meta .PHONY

ci: ci-${CITYPE:tl} .PHONY
ci: ci-create-meta ci-checktarget .WAIT ci-runtest-${TARGET_ARCH:tl} .WAIT ci-extract-meta .PHONY

.include "${RELEASEDIR}/Makefile.inc1"
32 changes: 27 additions & 5 deletions tests/ci/Makefile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ QEMU_EXTRA_PARAM=-bios /usr/local/share/u-boot/u-boot-qemu-arm64/u-boot.bin -cpu
QEMU_MAX_CPU_COUNT=64
QEMU_MAX_MEM_SIZE=64

portinstall-aarch64: portinstall-pkg .PHONY
.if !exists(/usr/local/share/u-boot/u-boot-qemu-arm64/u-boot.bin)
env ASSUME_ALWAYS_YES=yes pkg install sysutils/u-boot-qemu-arm64
.endif

# NOTE: Nothing should be changed below this line unless explicitly required.

ci-buildworld-aarch64: ci-buildworld .PHONY
Expand All @@ -26,4 +21,31 @@ ci-buildkernel-aarch64: ci-buildkernel .PHONY

ci-buildimage-aarch64: ci-buildimage .PHONY

.if ${MACHINE} == "arm64" && ( !defined(USE_QEMU) || empty(USE_QEMU) )
portinstall-aarch64: portinstall-pkg .PHONY
.if !exists(/usr/local/share/u-boot/u-boot-bhyve-arm64/u-boot.bin)
env ASSUME_ALWAYS_YES=yes pkg install sysutils/u-boot-bhyve-arm64
.endif

ci-runtest-aarch64: ci-buildimage-aarch64 .PHONY
/usr/sbin/bhyvectl --vm=${TEST_VM_NAME} --destroy || true
expect -c "set timeout ${TIMEOUT_EXPECT}; \
spawn /usr/bin/timeout -k 60 ${TIMEOUT_VM} /usr/sbin/bhyve \
-c ${PARALLEL_JOBS} -m ${VM_MEM_SIZE} \
-s 0:0,hostbridge \
-s 2:0,virtio-blk,${CIDISK} \
-s 3:0,virtio-blk,${META_TAR} \
${BHYVE_EXTRA_DISK_PARAM} \
-o console=stdio \
-o bootrom=/usr/local/share/u-boot/u-boot-bhyve-arm64/u-boot.bin \
${TEST_VM_NAME}; \
expect { eof }"
/usr/sbin/bhyvectl --vm=${TEST_VM_NAME} --destroy
.else
portinstall-aarch64: portinstall-pkg .PHONY
.if !exists(/usr/local/share/u-boot/u-boot-qemu-arm64/u-boot.bin)
env ASSUME_ALWAYS_YES=yes pkg install sysutils/u-boot-qemu-arm64
.endif

ci-runtest-aarch64: ci-runtest .PHONY
.endif
22 changes: 22 additions & 0 deletions tests/ci/Makefile.amd64
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,26 @@ ci-buildkernel-amd64: ci-buildkernel .PHONY

ci-buildimage-amd64: ci-buildimage .PHONY

.if ${MACHINE} == "amd64" && ( !defined(USE_QEMU) || empty(USE_QEMU) )
ci-runtest-amd64: ci-buildimage-amd64 .PHONY
/usr/sbin/bhyvectl --vm=${TEST_VM_NAME} --destroy || true
expect -c "set timeout ${TIMEOUT_EXPECT}; \
spawn /usr/bin/timeout -k 5s 30s /usr/sbin/bhyveload \
-c stdio -m ${VM_MEM_SIZE} -d ${CIDISK} ${TEST_VM_NAME}; \
expect { eof }; \
exit [lindex [wait] 3]"
expect -c "set timeout ${TIMEOUT_EXPECT}; \
spawn /usr/bin/timeout -k 60 ${TIMEOUT_VM} /usr/sbin/bhyve \
-c ${PARALLEL_JOBS} -m ${VM_MEM_SIZE} -A -H -P \
-s 0:0,hostbridge \
-s 1:0,lpc \
-s 2:0,virtio-blk,${CIDISK} \
-s 3:0,virtio-blk,${META_TAR} \
${BHYVE_EXTRA_DISK_PARAM} \
-l com1,stdio \
${TEST_VM_NAME}; \
expect { eof }"
/usr/sbin/bhyvectl --vm=${TEST_VM_NAME} --destroy
.else
ci-runtest-amd64: ci-runtest .PHONY
.endif
Loading