...
 
Commits (6)
......@@ -8,7 +8,13 @@ build/server.img:
@echo "precious" > build/preserve.txt
mcopy -i$@@@1M build/preserve.txt ::
build/server.vmdk: build/server.img
[ -f $< ] || VBoxManage internalcommands createrawvmdk -filename $@ -rawdisk `readlink -f $<`
[ -f $@ ] || VBoxManage internalcommands createrawvmdk -filename $@ -rawdisk `readlink -f $<`
@VBoxManage internalcommands sethduuid $@ 00000000-99aa-0000-8899-aabbccddeeff
build/server_data.vdi:
@mkdir -p build/empty
qemu-img convert -f vvfat -O vdi fat:32:build/empty $@
@VBoxManage internalcommands sethduuid $@ 11111111-99aa-0000-8899-aabbccddeeff
.PHONY: start-vms
start-vms: build/server.vmdk
......@@ -69,8 +75,8 @@ upload-rpi3zip: start-vms
scp -F $(BOUNDERY_SSHCONF) $(OS_SRC)/build/arm64/images/rpi3.zip \
root@boundery.me:/root/data/sslnginx/html/images/
test-linux-pczip: start-vms
# XXX stop (or destroy?) server.
test-linux-pczip: start-vms build/server_data.vdi
vagrant halt -f server
vagrant provision --provision-with install client
@mdel -ibuild/server.img@@1M ::/pairingkey 2>/dev/null || true
vagrant ssh client -c '/vagrant/run_test.sh pc' &
......@@ -79,3 +85,12 @@ test-linux-pczip: start-vms
# XXX boot server.
# XXX Wait for test completion
# XXX verify that preserve.txt contains "precious\n"
server-serial:
@script/vboxmgr controlvm server_VBOXID changeuartmode1 server build/serial_cons.sock
@echo "Ctrl-o to exit"
@socat UNIX-CONNECT:build/serial_cons.sock STDIO,raw,echo=0,escape=0x0f
client-vnc:
@script/vboxmgr client_VBOXID
gvncviewer localhost:0
......@@ -114,7 +114,8 @@ Vagrant.configure("2") do |config|
sudo apt-get update
#XXX We install python3-cffi-backend here due to a briefcase bug. bug 44?
sudo apt-get install -y --no-install-recommends network-manager xvfb x11vnc \
python3-cffi-backend python3-paramiko libnss3-tools
python3-selenium chromium-driver chromium-sandbox libnss3-tools \
python3-cffi-backend python3-paramiko
sudo cp /vagrant/fake_vagrant_sshd.py /usr/local/sbin/
......@@ -126,7 +127,7 @@ Vagrant.configure("2") do |config|
client.vm.provision "install", type: "shell", run: "never", privileged: false, inline: <<-SHELL
#XXX Sanity check fakedns, other environment stuff?
sudo /etc/rc.local #refetch ssl root cert in case pebble restarted.
sudo /etc/rc.local #Refetch ssl root cert in case pebble restarted.
rm -rf boundery-linux-client*
wget https://boundery.me/static/clients/boundery-linux-client.tar.gz
......@@ -134,7 +135,12 @@ Vagrant.configure("2") do |config|
#Make root cert available to client's embedded ca list.
cp /etc/ssl/certs/ca-certificates.crt boundery-linux-client/app_packages/certifi/cacert.pem
#Make root cert available to chromium/chromedriver's embedded ca list.
if [ ! -f .pki/nssdb/cert9.db ]; then
mkdir -p .pki/nssdb
certutil -N --empty-password -d sql:/home/vagrant/.pki/nssdb
fi
certutil -A -n "fakeroot" -t "TCu,Cu,Tu" -i /usr/local/share/ca-certificates/fakeroot.crt \
-d sql:/home/vagrant/.pki/nssdb || true
SHELL
......@@ -150,11 +156,15 @@ Vagrant.configure("2") do |config|
vb.customize ["modifyvm", :id, "--firmware", "efi"]
vb.customize ['storageattach', :id, '--storagectl', 'SATA', '--port', 1, '--device', 0,
#--port 0 clobbers the empty /dev/sda image in the base box.
vb.customize ['storageattach', :id, '--storagectl', 'SATA', '--port', 0, '--device', 0,
'--type', 'hdd', '--mtype', 'shareable', '--hotpluggable', 'on',
'--medium', File.join(build_dir, "server.vmdk")]
vb.customize ['storageattach', :id, '--storagectl', 'SATA', '--port', 1, '--device', 0,
'--type', 'hdd', '--hotpluggable', 'on',
'--medium', File.join(build_dir, "server_data.vdi")]
serial_log = File.join(build_dir, "server_cons.log")
serial_log = File.join(build_dir, "serial_cons.log")
vb.customize ["modifyvm", :id, "--uart1", "0x3F8", "4", "--uartmode1", "file", serial_log]
end
......@@ -168,6 +178,5 @@ Vagrant.configure("2") do |config|
server.vm.synced_folder ".", "/vagrant", disabled: true
#XXX Need to figure out how to get pebble's root cert into the os...
#XXX Attach USB stick for RW storage.
end
end
#!/bin/bash
ARGS=()
for arg in "$@"; do
if echo "$arg" | grep -q '_VBOXID$'; then
arg=`echo $arg | sed 's/_VBOXID$//1'`
if [ ! -f ".vagrant/machines/$arg/virtualbox/id" ]; then
echo "$arg is not running" >&2
exit 99
fi
ARGS+=(`cat .vagrant/machines/$arg/virtualbox/id`)
else
ARGS+=("$arg")
fi
done
VBoxManage "${ARGS[@]}"