Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
211 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
type: system-user | ||
authority-id: ezPmSahqWjPQWhv3o4cY0MG0JkqpKIoL | ||
revision: 1 | ||
brand-id: ezPmSahqWjPQWhv3o4cY0MG0JkqpKIoL | ||
email: snappy-dev@lists.launchpad.net | ||
models: | ||
- pc | ||
- pc-i386 | ||
- pi2 | ||
name: user1 | ||
password: $6$o5er943Y$cngsJHutSgACVbR65WAnhaUPC9.vENj8locb50hvMdMRMK8cQ3Zbu6WPh5Al2JrnHzpR63osPCwE/IFG/2s6K1 | ||
series: | ||
- 16 | ||
since: 2016-10-10T15:03:21+00:00 | ||
until: 2017-10-09T15:03:21+00:00 | ||
username: user1 | ||
sign-key-sha3-384: uv2i3nctwgiMQQ2rd_9mhwHsQbTRJPHnpeQjpRbSfs4m3lxhH2E89wkKKqYp_8i5 | ||
|
||
AcLBXAQAAQoABgUCWD1lgAAKCRCi4irWmF+hRcO6D/9FpYFqLxz8mzyI31js9TfmsVOuaWpe6DBn | ||
Nu2Ay168waDgOMtTU1MBONn5qeX44mukSz0v5XL6SIRcrVPRavM1Epfda/IRizysLcPe1cMoh1iq | ||
hEarVS6V63MZgmGPgrfv9NXL7eoU+w+OXOcrxonZnIMiq4EwRY4udBYCMWAXRO4tQkIyNmXXdJqd | ||
8JVo0pUfZDkRq8SAOt2FzSxVVpPcUyos7rLExzAsN6YCflatcW23gjfjx8EVzka+Pg25pyevz11x | ||
srsg641cXTSVznN9k62BhOgrTgZXuunrhYRoe6/sAfq2By8yzsf9rv9bNYBDyH1CTk3ejUt/NJyu | ||
Xs2mv6pXERrIz2SXJoz7VO6UnzNte4vVni0vs117wJevOnVdymjxcbDwseHs2PgZag+lCdSADwGI | ||
NhMHzB/XZ+eMaGv3yPSsHZ9nU+YgwiuR5QeI6AqfoQqbi3HF1LVNMptsnbMX346zgI8iKKL22bqA | ||
bXC21F22aotXsaLo6v/TlaBStIggxY5HQ0+FHLR4sfYtiFFGF277eIuDSN8EHv1S/4klDBv2qXzu | ||
PtSUE+u9HMCAum8arnGzpgPW8KZBHLdA9pp/ibLsRJrbuqGWZPHGLkBjLWBCSd/a19mYyD5GzeUf | ||
FwdVIDMvilpIPzKm2HzX5SLJrbIz0eMeGR7dqOK7ug== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
type: model | ||
authority-id: ezPmSahqWjPQWhv3o4cY0MG0JkqpKIoL | ||
series: 16 | ||
brand-id: ezPmSahqWjPQWhv3o4cY0MG0JkqpKIoL | ||
model: pc-i386 | ||
architecture: i386 | ||
gadget: pc | ||
kernel: pc-kernel | ||
timestamp: 2016-10-17T15:03:21+00:00 | ||
sign-key-sha3-384: uv2i3nctwgiMQQ2rd_9mhwHsQbTRJPHnpeQjpRbSfs4m3lxhH2E89wkKKqYp_8i5 | ||
|
||
AcLBXAQAAQoABgUCWDWJMgAKCRCi4irWmF+hReubEACMULpTI/ofsj+lhOEoI1E5LzygXmpqDnrg | ||
3PG4hv4V0URKRSv9vZwjEi49TgMXkG6MWg/A6XuszIftHjifbbvdb8mqtwqlWpFWKMH6ueugwMqn | ||
BVj0Ja/APr/xlVTtMaWCxiAdVfhz9ZEuFHESZ7l2Ok8E9JXD2tan7QZNSfQN+p2eX9fhNIH7tQGK | ||
+nDxc97VRLUy8yGTPZpDsLTXE73RYsgDwbbeXrXORwz4mr/BZN8btzOHs5myRh5Tt3clA7Xqyh9j | ||
xOiNx+v8h6tpKG77ONN5yY3S7lp5DQEBMjTkuRBjQ2/JCp4mYwgw5j+tvbMFGRL82yTyVWi5re3P | ||
Kjw/PKxtmtDYdgOiuLpsTYU0O4zXxK8bQq6Fxmm2zXFnQ+yFWzRGQa2kNRSM45/Y4913ilBt5+rS | ||
cs8c0lYJGM+3Ei5AjQo93r0KKrh7zu2b6P+38AH+2/RrNB7+ZCOrHK2tYBgkjUkqcuXNzj5/xhMc | ||
izCiIuRu+LlmTLmT9QSsbxQJXFRZOlTAnnp0RjfdFHHyGVsNDB8glk5iqSeqp9ACjIJcEgFOM807 | ||
GdYX/0ssj6XzKPaaI8a7+n7Z05uo2gvuIU6o+RWc4f7ZWulbdARfM3ht05E/FaSO+wnzeR28X6bE | ||
so23WNyYy0o3GYcmbMmI4McWobg4cmpz+tViZtu5iQ== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
type: model | ||
authority-id: ezPmSahqWjPQWhv3o4cY0MG0JkqpKIoL | ||
series: 16 | ||
brand-id: ezPmSahqWjPQWhv3o4cY0MG0JkqpKIoL | ||
model: pc | ||
architecture: amd64 | ||
gadget: pc | ||
kernel: pc-kernel | ||
timestamp: 2016-09-16T15:03:21+00:00 | ||
sign-key-sha3-384: uv2i3nctwgiMQQ2rd_9mhwHsQbTRJPHnpeQjpRbSfs4m3lxhH2E89wkKKqYp_8i5 | ||
|
||
AcLBXAQAAQoABgUCV+JS/QAKCRCi4irWmF+hRWiBD/43ZWNoYff2lQXdmqAHGmfnCp13GqaSNBvf | ||
rfOYw7rOoQK1FeAdijfzLfoBEaP+CfPB7WdenTQGRxwX2z1p8sSxPyD9eXjw/spzdhIh6/8lp8yC | ||
4Dq3G9r9ySbokExwsV4XQnly9dWPzZP+DejxyroUFERsj3drEEI94b7aN/fUEYeqU1QEIOi+VCmT | ||
t9iGV+fUYuk7UBIOOVqLmSKgqOw3NsmSjLbASsl4SsyQ3eMQoNs8hzCmp2N/IrwMXPoUu7Ivi/zZ | ||
bOIiCGC1YPrWJzUZ4C/B89EiilOPHnk98Umr76tIM7X0EnS8cYnyuLx9hDczLC5a2uE0PC45rmZB | ||
abjkTVea6i735RrE6Ffw/aWLMfp32vL7JOnOqkyzp/2g0IyYAyY3wvVea2IyWhI2wz532Es71gEa | ||
MAu8jiWn3rncvQNf0j2eCzhg0ZJ7G0+Qe19D7heLCP+/tpt+kOYDT0o8+drezRMuIiU5JE4/sxan | ||
YVRjpYzQPuNx13elAzJXy+24wnKMOwUuHCm25TMUPI1j/3Fw2xPqqYnkhkR6OaBF0ZuAxRYMUsWw | ||
gKWGS2nim2+DVh2d4NbAQtYDVRqAm/jCY0180aZ9/G2iqk66pMGDW9Njy9Rl+YgXyyqn6PYpSt6r | ||
v0ZF1XkDWGLaB2ohNugO6j8fp0MiKWs3WPWdnsXVIw== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
type: model | ||
authority-id: ezPmSahqWjPQWhv3o4cY0MG0JkqpKIoL | ||
series: 16 | ||
brand-id: ezPmSahqWjPQWhv3o4cY0MG0JkqpKIoL | ||
model: pi2 | ||
architecture: armhf | ||
gadget: pi2 | ||
kernel: pi2-kernel | ||
timestamp: 2016-09-16T15:03:21+00:00 | ||
sign-key-sha3-384: uv2i3nctwgiMQQ2rd_9mhwHsQbTRJPHnpeQjpRbSfs4m3lxhH2E89wkKKqYp_8i5 | ||
|
||
AcLBXAQAAQoABgUCV+JS8AAKCRCi4irWmF+hRXa3EACwVgcYNRrnAOeAzybAWy7M8HHB2j7xultB | ||
ESO/HTvw3e8dIB2mF8SyVtLWZG611ZNoa59Q4kjZAm8bGqE7Qq44oRRBRak5QhBG4AlU/PKAhot1 | ||
2vRTFzNeWZRW6Tvc60mA9GvVA98Ck9QeTAtixYifP+032PdRj9hdIimeCAuCfl2QMms0C6+FFgVO | ||
dyE67AzZpiQzTytr01U/ScVkJCyJJKGAZaJ/8DDgELSkZEcuJ6EkOnKdcnyPgo6+KppIdK9AT3hL | ||
E2ZNEHap1FMxcutxRvXyO4PvJlNenHjg1TZIbX4Tw6/TwRCKEvoaRMglTKiUJ9PNAOp9AU11kekl | ||
j8+dyWjCNUEC4t2RrTuVS0c77Zxfj1zf31a9HyM9DWtiTytgF6kkpy7g/fpNweJc/P2ikQh21hYm | ||
9Epu9iVsb3baD3KTIrNypsBqnWkQJC+BE1M+vywZD941QXfH5qgZpUYHn9pk6WfXa3ROfp4y7iaD | ||
K1xp+tYwToSzv8gtQz77sVF9FMzcPnZYnDbUO2yVCZsYWBtSHRFbL2iHDyWPYi0Be0c/VyeJ5LIG | ||
ydzjNelbF+5kOSowWVD8vDlt7nx3hl4HYJKkrAAtWXwPJFMAKdyMLA5QdP1lRMDZ+vZweuoZiKz5 | ||
Q8upmKnwU0deeYTVC6BzZcq6m8VyVBVZ5rB5NhAJUw== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/sh | ||
execute_remote(){ | ||
sshpass -p $PASSWORD ssh -p $SSH_PORT -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $USER@localhost "$*" | ||
} | ||
|
||
prepare_ssh(){ | ||
execute_remote "sudo adduser --extrausers --quiet --disabled-password --gecos '' test" | ||
execute_remote "echo test:ubuntu | sudo chpasswd" | ||
execute_remote "echo 'test ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/test-user" | ||
} | ||
|
||
wait_for_ssh(){ | ||
retry=300 | ||
while ! execute_remote true; do | ||
retry=$(( retry - 1 )) | ||
if [ $retry -le 0 ]; then | ||
echo "Timed out waiting for ssh. Aborting!" | ||
exit 1 | ||
fi | ||
sleep 1 | ||
done | ||
} | ||
|
||
set_vars(){ | ||
case "$NESTED_ARCH" in | ||
amd64) | ||
model_file=pc.model | ||
vm_unit_command="$(which qemu-system-x86_64) ${VM_UNIT_COMMAND_SUFFIX}" | ||
spread_system="ubuntu-core-16-64" | ||
;; | ||
i386) | ||
model_file=pc-i386.model | ||
vm_unit_command="$(which qemu-system-i386) ${VM_UNIT_COMMAND_SUFFIX}" | ||
spread_system="ubuntu-core-16-64" | ||
;; | ||
*) | ||
echo "unsupported architecture" | ||
exit 1 | ||
;; | ||
esac | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
summary: create ubuntu-core image and execute the suite in a nested qemu instance | ||
|
||
systems: [ubuntu-16.04-64] | ||
|
||
environment: | ||
SSH_PORT: 8022 | ||
USER: user1 | ||
PASSWORD: ubuntu | ||
SPREAD_EXTERNAL_ADDRESS: "localhost:8022" | ||
WORK_DIR: /tmp/work-dir | ||
TAP_DEVICE: tap0 | ||
VM_UNIT_COMMAND_SUFFIX: "-m 1024 -nographic -net nic,model=virtio -net user,hostfwd=tcp::${SSH_PORT}-:22 -drive file=${WORK_DIR}/ubuntu-core.img,if=virtio,cache=none -drive file=${PWD}/assertions.disk,if=virtio,cache=none" | ||
|
||
prepare: | | ||
. $TESTSLIB/nested.sh | ||
# determine arch related vars | ||
set_vars | ||
# create ubuntu-core image | ||
mkdir -p $WORK_DIR | ||
snap install --devmode --edge ubuntu-image | ||
/snap/bin/ubuntu-image --image-size 3G $TESTSLIB/assertions/$model_file --channel $CORE_CHANNEL --output ubuntu-core.img | ||
mv ubuntu-core.img $WORK_DIR | ||
# create assertion block device | ||
genisoimage -volid cidata -joliet -rock -o assertions.disk $TESTSLIB/assertions/auto-import.assert | ||
#setup_bridge $TAP_DEVICE | ||
. $TESTSLIB/systemd.sh | ||
systemd_create_and_start_unit nested-vm "$vm_unit_command" | ||
restore: | | ||
snap remove ubuntu-image | ||
. $TESTSLIB/systemd.sh | ||
systemd_stop_and_destroy_unit nested-vm | ||
rm -rf $WORK_DIR | ||
#. $TESTSLIB/nested.sh | ||
#teardown_bridge $TAP_DEVICE | ||
execute: | | ||
. $TESTSLIB/nested.sh | ||
wait_for_ssh | ||
prepare_ssh | ||
cd $SPREAD_PATH | ||
curl -s -O https://niemeyer.s3.amazonaws.com/spread-amd64.tar.gz && tar xzvf spread-amd64.tar.gz && rm -f spread-amd64.tar.gz && mv spread $WORK_DIR | ||
$WORK_DIR/spread -v external:ubuntu-core-16-64:tests/main/ubuntu-core-reboot \ | ||
external:ubuntu-core-16-64:tests/main/install-sideload \ | ||
external:ubuntu-core-16-64:tests/main/install-store \ | ||
external:ubuntu-core-16-64:tests/main/interfaces-firewall-control \ | ||
external:ubuntu-core-16-64:tests/main/interfaces-system-observe \ | ||
external:ubuntu-core-16-64:tests/main/ubuntu-core-classic |