Add test case of strict mode
authoryyh <yyh@123.com>
Fri, 22 Jan 2016 11:17:29 +0000 (19:17 +0800)
committeryyh <yyh@123.com>
Fri, 22 Jan 2016 11:18:20 +0000 (19:18 +0800)
Change-Id: Ie20b2be563530c7cf2a7a7e59a1a411abf7f6fd8

cases/create/mixed_cases/mic_cr_strict_mode_image.case [new file with mode: 0644]

diff --git a/cases/create/mixed_cases/mic_cr_strict_mode_image.case b/cases/create/mixed_cases/mic_cr_strict_mode_image.case
new file mode 100644 (file)
index 0000000..89570ab
--- /dev/null
@@ -0,0 +1,34 @@
+<testcase>
+    <summary>Test option "--strict-mode", if this given, mic will abort creating image, if some rpm pagages fail to install</summary>
+    <fixtures>
+        <copy src="ks_files/strict_mode.ks" />
+        <copydir src="rpm/strict_mode_rpm" />
+    </fixtures>
+    <steps>
+        <![CDATA[
+#create local repo
+mkdir -p /home/build/strict_mode/
+cp  ./strict_mode_rpm/*  /home/build/strict_mode/
+createrepo /home/build/strict_mode
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+#zypp pkg manager
+sudo mic -d -v cr loop strict_mode.ks --logfile=./log/handset.log
+grep 'Finished' ./log/handset.log
+#zypp pkg manager strict mode
+(! sudo mic -d -v cr loop strict_mode.ks --logfile=./log/handset.log --strict-mode)
+grep 'mic failes to install some packages' ./log/handset.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+    ]]>
+ </steps>
+ <teardown>
+        <![CDATA[
+echo "cleaning..."
+sudo test -e ./mic-output && sudo rm -rf ./mic-output
+test -e ./log/handset.log && sudo rm ./log/handset.log
+test -e /home/build/strict_mode && sudo rm -rf /home/build/strict_mode
+        ]]>
+    </teardown>
+</testcase>