summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-02-14 15:22:12 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-02-14 15:22:12 +0000
commit7f5045a678d2b2a938c57f786382c537314e1b43 (patch)
tree4eb1a428aec53580c7be2fb63c957210dd2dd517
parentc3c6d9834ac10caf402222ac6d04a130df5bfbbc (diff)
downloadtbdiff-7f5045a678d2b2a938c57f786382c537314e1b43.tar.gz
fixup Add tests
-rw-r--r--baserock-system-config-sync/files/basefile1
-rw-r--r--baserock-system-config-sync/files/new-basefile1
-rw-r--r--baserock-system-config-sync/files/userfile3
-rw-r--r--baserock-system-config-sync/test.yarn27
4 files changed, 30 insertions, 2 deletions
diff --git a/baserock-system-config-sync/files/basefile b/baserock-system-config-sync/files/basefile
index e69de29..742f55c 100644
--- a/baserock-system-config-sync/files/basefile
+++ b/baserock-system-config-sync/files/basefile
@@ -0,0 +1 @@
+HEADER VERSION OLD
diff --git a/baserock-system-config-sync/files/new-basefile b/baserock-system-config-sync/files/new-basefile
index e69de29..c6de67a 100644
--- a/baserock-system-config-sync/files/new-basefile
+++ b/baserock-system-config-sync/files/new-basefile
@@ -0,0 +1 @@
+HEADER VERSION NEW
diff --git a/baserock-system-config-sync/files/userfile b/baserock-system-config-sync/files/userfile
index e69de29..7be54a0 100644
--- a/baserock-system-config-sync/files/userfile
+++ b/baserock-system-config-sync/files/userfile
@@ -0,0 +1,3 @@
+HEADER VERSION OLD
+
+USER CONTENT OF THE VERSION OLD
diff --git a/baserock-system-config-sync/test.yarn b/baserock-system-config-sync/test.yarn
index 09c20c3..41fe620 100644
--- a/baserock-system-config-sync/test.yarn
+++ b/baserock-system-config-sync/test.yarn
@@ -25,6 +25,9 @@
AND the version foo is the default
THEN bscs merge the version new-foo
AND version new-foo has the file basefile
+ FINALLY set factory as default
+ AND remove foo
+ AND remove new-foo
3
@@ -35,16 +38,22 @@
AND the version foo is the default
THEN bscs merge the version new-foo
AND version new-foo has the file userfile
+ FINALLY set factory as default
+ AND remove foo
+ AND remove new-foo
4
SCENARIO The new version adds a file
GIVEN a version called foo
AND a version called new-foo
- AND a new-basefile in the running version foo-new
+ AND a new-basefile in the running version new-foo
AND the version foo is the default
THEN bscs merge the version new-foo
AND version new-foo has the file new-basefile
+ FINALLY set factory as default
+ AND remove foo
+ AND remove new-foo
5
@@ -56,6 +65,9 @@
AND the version foo is the default
THEN bscs merge the version new-foo
AND version new-foo has the file new-basefile
+ FINALLY set factory as default
+ AND remove foo
+ AND remove new-foo
6
@@ -68,6 +80,9 @@
AND the version foo is the default
THEN bscs merge the version new-foo
AND version new-foo has the file userfile
+ FINALLY set factory as default
+ AND remove foo
+ AND remove new-foo
7 patch applies
@@ -82,7 +97,9 @@ $
tmpdir=$(mktemp -d)
mount_disk="$(findmnt / -n -l -o SOURCE | cut -f 1 | cut -d [ -f 1)"
mount $mount_disk $tmpdir
- rm -r $tmpdir/systems/$MATCH_1
+ if [ -d $tmpdir/systems/$MATCH_1 ]; then
+ rm -r $tmpdir/systems/$MATCH_1
+ fi
mkdir $tmpdir/systems/$MATCH_1
mkdir -p $tmpdir/systems/$MATCH_1/orig/etc
mkdir -p $tmpdir/systems/$MATCH_1/run/etc
@@ -119,3 +136,9 @@ $
umount $tmpdir
rm -r $tmpdir
+
+ IMPLEMENTS FINALLY set (\S+) as default
+ snapshot-mgr set-default $MATCH_1
+
+ IMPLEMENTS FINALLY remove (\S+)
+ snapshot-mgr remove $MATCH_1