Permalink
Browse files

tests: fix failover test

This test is failing in dragonboard and pi2/3. The error is seeing when
the test builds and installs snaps using the /tmp (which is tmpfs) and
the error is "out of space".

The fix uses a diferent dir to build the snaps.
  • Loading branch information...
1 parent 9691a48 commit f1cf4755312713f8024a4c29e1b0173dd4a42419 @sergiocazzolato sergiocazzolato committed Aug 8, 2017
Showing with 11 additions and 7 deletions.
  1. +11 −7 tests/main/failover/task.yaml
@@ -21,10 +21,14 @@ environment:
TARGET_SNAP/rclocalcrash: core
TARGET_SNAP/emptysystemd: core
#TARGET_SNAP/emptyinitrd: kernel
+ BUILD_DIR: /home/tmp
+
+prepare: |
+ mkdir -p $BUILD_DIR
restore: |
rm -f failing.snap failBoot currentBoot prevBoot
- rm -rf /tmp/unpack
+ rm -rf $BUILD_DIR
# FIXME: remove the unset when we reset properly snap_try_{core,kernel} on rollback
. $TESTSLIB/boot.sh
@@ -39,19 +43,19 @@ debug: |
execute: |
inject_rclocalcrash_failure(){
- chmod a+x /tmp/unpack/etc/rc.local
- cat <<EOF > /tmp/unpack/etc/rc.local
+ chmod a+x $BUILD_DIR/unpack/etc/rc.local
+ cat <<EOF > $BUILD_DIR/unpack/etc/rc.local
#!bin/sh
printf c > /proc/sysrq-trigger
EOF
}
inject_emptysystemd_failure(){
- truncate -s 0 /tmp/unpack/lib/systemd/systemd
+ truncate -s 0 $BUILD_DIR/unpack/lib/systemd/systemd
}
inject_emptyinitrd_failure(){
- truncate -s 0 /tmp/unpack/initrd.img
+ truncate -s 0 $BUILD_DIR/unpack/initrd.img
}
. $TESTSLIB/names.sh
@@ -67,13 +71,13 @@ execute: |
snap list | awk "/^${TARGET_SNAP_NAME} / {print(\$3)}" > prevBoot
# unpack current target snap
- unsquashfs -d /tmp/unpack /var/lib/snapd/snaps/${TARGET_SNAP_NAME}_$(cat prevBoot).snap
+ unsquashfs -d $BUILD_DIR/unpack /var/lib/snapd/snaps/${TARGET_SNAP_NAME}_$(cat prevBoot).snap
# set failure condition
eval ${INJECT_FAILURE}
# repack new target snap
- snapbuild /tmp/unpack . && mv ${TARGET_SNAP_NAME}_*.snap failing.snap
+ snapbuild $BUILD_DIR/unpack . && mv ${TARGET_SNAP_NAME}_*.snap failing.snap
# install new target snap
chg_id=$(snap install --dangerous failing.snap --no-wait)

1 comment on commit f1cf475

+ unsquashfs -d /home/tmp/unpack /var/lib/snapd/snaps/core_2466.snap
Parallel unsquashfs: Using 4 processors
11926 inodes (12725 blocks) to write

[===========================================================|] 12725/12725 100%

created 9324 files
created 1444 directories
created 2513 symlinks
created 79 devices
created 0 fifos
+ eval inject_emptysystemd_failure
++ inject_emptysystemd_failure
++ truncate -s 0 /home/tmp/unpack/lib/systemd/systemd
+ snapbuild /home/tmp/unpack .
snapbuild: unable to copy /home/tmp/unpack/var/lib/classic/classic-diff.tgz to /tmp/snappy-build-269831630/var/lib/classic/classic-diff.tgz: no space left on device
++ snap install --dangerous failing.snap --no-wait
error: cannot open: "failing.snap"
+ chg_id=
-----
2017/08/10 09:14:12 Debug output for external:ubuntu-core-16-arm-32:tests/main/failover:emptysystemd : 
-----

But snapbuild will copy classic-diff.tgz to /tmp, there is still a hint of no space left on device. How to solve to it?

Please sign in to comment.