Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.
Merged
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
9 changes: 9 additions & 0 deletions integration/vm_factory/vm_templating_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,19 @@ check_vm_template_network_setup() {
[[ ${IPADDR} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]] || die "vm eth0 ip is ${IPADDR}"
}

check_new_guest_date_time() {
HOSTTIME=$(date +%s)
GUESTTIME=$(sudo docker exec $CONTAINER_NAME date +%s)
[[ ${HOSTTIME} -le ${GUESTTIME} ]] || die "hosttime ${HOSTTIME} guesttime ${GUESTTIME}"
}

test_create_container_with_vm_template() {
# sleep a bit so that template VM time is in the past
sleep 2
sudo docker run --runtime=$RUNTIME -d --name $CONTAINER_NAME $IMAGE $PAYLOAD_ARGS
check_qemu_for_vm_template
check_vm_template_network_setup
check_new_guest_date_time
sudo docker rm -f $CONTAINER_NAME
}

Expand Down