ncp-vm: add automatic testing and change default root password

Signed-off-by: nachoparker <nacho@ownyourbits.com>
This commit is contained in:
nachoparker 2021-10-27 13:15:18 -06:00
parent ccf957fcde
commit 41368fedfc
6 changed files with 27 additions and 6 deletions

5
build/Vagrantfile vendored
View File

@ -17,6 +17,10 @@ Vagrant.configure("2") do |config|
config.vm.box = "debian/#{release}64"
config.vm.box_check_update = true
config.vm.hostname = "ncp-vm"
config.vm.define "ncp-vm"
config.vm.provider :libvirt do |libvirt|
libvirt.default_prefix = ""
end
config.vm.synced_folder '.', '/vagrant', disabled: true
@ -39,6 +43,7 @@ Vagrant.configure("2") do |config|
run_app_unsafe post-inst.sh
cd /
rm -r /tmp/nextcloudpi
echo "root:ownyourbits" | chpasswd
systemctl disable sshd
poweroff
SHELL

View File

@ -35,10 +35,14 @@ build/build-LXD.sh
# Docker x86
build/build-docker.sh x86
# VM
build/build-VM.sh
# Tests
[[ "${SKIP_TESTS}" != 1 ]] && {
test_lxc
test_docker
test_vm
}
# Docker other
@ -60,9 +64,6 @@ build/build-SD-armbian.sh odroidc4 OdroidC4
build/build-SD-armbian.sh odroidc2 OdroidC2
#build/build-SD-armbian.sh orangepizeroplus2-h5 OrangePiZeroPlus2
# VM
build/build-VM.sh
# Uploads
[[ "$FTPPASS" == "" ]] && exit
upload_docker

View File

@ -18,7 +18,7 @@ SIZE=3G # Raspbian image size
#CLEAN=0 # Pass this envvar to skip cleaning download cache
IMG="NextCloudPi_VM_$( date "+%m-%d-%y" ).img"
IMG=tmp/"$IMG"
VM="/var/lib/libvirt/images/nextcloudpi_default.img"
VM="/var/lib/libvirt/images/ncp-vm.img"
TAR=output/"$( basename "$IMG" .img ).tar.bz2"

View File

@ -461,6 +461,21 @@ function test_lxc()
lxc stop ncp
}
function test_vm()
{
local ip
virsh --connect qemu:///system shutdown ncp-vm &>/dev/null || true
virsh --connect qemu:///system start ncp-vm
while [[ "${ip}" == "" ]]; do
ip="$(virsh --connect qemu:///system domifaddr ncp-vm | grep ipv4 | awk '{ print $4 }' | sed 's|/24||' )"
sleep 0.5
done
tests/activation_tests.py "${ip}"
tests/nextcloud_tests.py "${ip}"
#tests/system_tests.py
virsh --connect qemu:///system shutdown ncp-vm
}
# License
#
# This script is free software; you can redistribute it and/or modify it

View File

@ -1,7 +1,7 @@
version: '3'
services:
nextcloudpi-dev:
image: ownyourbits/nextcloudpi-x86
image: ownyourbits/nextcloudpi
command: "${IP}"
ports:
- "80:80"

View File

@ -1,7 +1,7 @@
version: '3'
services:
nextcloudpi:
image: ownyourbits/nextcloudpi-x86
image: ownyourbits/nextcloudpi
command: "${IP}"
ports:
- "80:80"