Skip to content

Commit 41368fe

Browse files
committed
ncp-vm: add automatic testing and change default root password
Signed-off-by: nachoparker <nacho@ownyourbits.com>
1 parent ccf957f commit 41368fe

File tree

6 files changed

+27
-6
lines changed

6 files changed

+27
-6
lines changed

build/Vagrantfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ Vagrant.configure("2") do |config|
1717
config.vm.box = "debian/#{release}64"
1818
config.vm.box_check_update = true
1919
config.vm.hostname = "ncp-vm"
20+
config.vm.define "ncp-vm"
21+
config.vm.provider :libvirt do |libvirt|
22+
libvirt.default_prefix = ""
23+
end
2024

2125
config.vm.synced_folder '.', '/vagrant', disabled: true
2226

@@ -39,6 +43,7 @@ Vagrant.configure("2") do |config|
3943
run_app_unsafe post-inst.sh
4044
cd /
4145
rm -r /tmp/nextcloudpi
46+
echo "root:ownyourbits" | chpasswd
4247
systemctl disable sshd
4348
poweroff
4449
SHELL

build/batch.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,14 @@ build/build-LXD.sh
3535
# Docker x86
3636
build/build-docker.sh x86
3737

38+
# VM
39+
build/build-VM.sh
40+
3841
# Tests
3942
[[ "${SKIP_TESTS}" != 1 ]] && {
4043
test_lxc
4144
test_docker
45+
test_vm
4246
}
4347

4448
# Docker other
@@ -60,9 +64,6 @@ build/build-SD-armbian.sh odroidc4 OdroidC4
6064
build/build-SD-armbian.sh odroidc2 OdroidC2
6165
#build/build-SD-armbian.sh orangepizeroplus2-h5 OrangePiZeroPlus2
6266

63-
# VM
64-
build/build-VM.sh
65-
6667
# Uploads
6768
[[ "$FTPPASS" == "" ]] && exit
6869
upload_docker

build/build-VM.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ SIZE=3G # Raspbian image size
1818
#CLEAN=0 # Pass this envvar to skip cleaning download cache
1919
IMG="NextCloudPi_VM_$( date "+%m-%d-%y" ).img"
2020
IMG=tmp/"$IMG"
21-
VM="/var/lib/libvirt/images/nextcloudpi_default.img"
21+
VM="/var/lib/libvirt/images/ncp-vm.img"
2222

2323
TAR=output/"$( basename "$IMG" .img ).tar.bz2"
2424

build/buildlib.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,21 @@ function test_lxc()
461461
lxc stop ncp
462462
}
463463

464+
function test_vm()
465+
{
466+
local ip
467+
virsh --connect qemu:///system shutdown ncp-vm &>/dev/null || true
468+
virsh --connect qemu:///system start ncp-vm
469+
while [[ "${ip}" == "" ]]; do
470+
ip="$(virsh --connect qemu:///system domifaddr ncp-vm | grep ipv4 | awk '{ print $4 }' | sed 's|/24||' )"
471+
sleep 0.5
472+
done
473+
tests/activation_tests.py "${ip}"
474+
tests/nextcloud_tests.py "${ip}"
475+
#tests/system_tests.py
476+
virsh --connect qemu:///system shutdown ncp-vm
477+
}
478+
464479
# License
465480
#
466481
# This script is free software; you can redistribute it and/or modify it

build/docker/docker-compose-ncpdev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22
services:
33
nextcloudpi-dev:
4-
image: ownyourbits/nextcloudpi-x86
4+
image: ownyourbits/nextcloudpi
55
command: "${IP}"
66
ports:
77
- "80:80"

build/docker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22
services:
33
nextcloudpi:
4-
image: ownyourbits/nextcloudpi-x86
4+
image: ownyourbits/nextcloudpi
55
command: "${IP}"
66
ports:
77
- "80:80"

0 commit comments

Comments
 (0)