]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
Test slightly more code paths.
authorMartin Vidner <mvidner@suse.cz>
Wed, 15 Jan 2020 09:36:17 +0000 (10:36 +0100)
committerMartin Vidner <mvidner@suse.cz>
Wed, 15 Jan 2020 09:36:17 +0000 (10:36 +0100)
zypp-plugin/testsuite/1-happy.test
zypp-plugin/testsuite/Makefile.am
zypp-plugin/testsuite/test-helper.sh
zypp-plugin/testsuite/zypp-plugin-maxcover.conf [new file with mode: 0644]

index fec0c8be5e88261a8a402874631aa9327a91b829..11961522974f9b3a7a17af3f08c2dea878972d31 100755 (executable)
@@ -12,7 +12,7 @@ echo 1..4
 
 TEST="1 - It wants to make pre and post snapshots"
 rm -f mock-snapperd.log
-test_pre_post_snapshots | runit ../../data/zypp-plugin.conf > /dev/null
+test_pre_post_snapshots | runit zypp-plugin-maxcover.conf > /dev/null
 if [ "${PIPESTATUS[1]}" != 0 ]; then
     echo -n "not "
 fi
@@ -26,7 +26,7 @@ echo "ok $TEST"
 
 TEST="3 - It wants to make and delete pre snapshot"
 rm -f mock-snapperd.log
-test_pre_del_snapshots  | runit ../../data/zypp-plugin.conf > /dev/null
+test_pre_del_snapshots  | runit zypp-plugin-maxcover.conf > /dev/null
 if [ "${PIPESTATUS[1]}" != 0 ]; then
     echo -n "not "
 fi
index ba7523c39522872fb9435bd7086bceb5354dd1c9..0e84173af325f78dbde58a7e62b75fafa9f19ecf 100644 (file)
@@ -3,7 +3,10 @@ TEST_LOG_DRIVER = $(SHELL) tap-driver.sh
 
 check_SCRIPTS = 1-happy.test 2-malformed-xml.test 3-invalid-xml.test 4-badjson.test 99-shell.test
 noinst_SCRIPTS = mock-snapperd test-helper.sh
-noinst_DATA = zypp-plugin-malformed.conf zypp-plugin-invalid.conf
+noinst_DATA = \
+       zypp-plugin-invalid.conf \
+       zypp-plugin-malformed.conf \
+       zypp-plugin-maxcover.conf
 
 # Hack: these tests both use mock-snapperd which is not paralellized
 # so serialize them
index 89461f670ce135a6f25f3f37c2b3c06593e7063f..c74098219edf1fe3d20ba067aee974eff621710f 100644 (file)
@@ -54,6 +54,8 @@ test_pre_post_snapshots() {
     stomp_message COMMITBEGIN "" "$(json mypkg)"
     stomp_message COMMITEND "" "$(json mypkg)"
     stomp_message PLUGINEND "" ""
+    stomp_message UNKNOWNMESSAGE "" ""
+    stomp_message _DISCONNECT "" ""
 }
 
 test_pre_del_snapshots() {
diff --git a/zypp-plugin/testsuite/zypp-plugin-maxcover.conf b/zypp-plugin/testsuite/zypp-plugin-maxcover.conf
new file mode 100644 (file)
index 0000000..63064c4
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<snapper-zypp-plugin-conf>
+  <!--
+  A default config extended so that more code paths are tested
+  -->
+  <solvables>
+    <solvable match="w" important="true">kernel-*</solvable>
+    <solvable match="w" important="true">dracut</solvable>
+    <solvable match="w" important="true">glibc</solvable>
+    <solvable match="w" important="true">systemd*</solvable>
+    <solvable match="w" important="true">udev</solvable>
+    <solvable match="re" important="true">my[_-]?pkg</solvable>
+    <solvable>ignored-no-match-attr</solvable>
+    <solvable match="w">*</solvable>
+  </solvables>
+
+</snapper-zypp-plugin-conf>