add check env section case
authorXiao Jin <jin.xiao@samsung.com>
Thu, 25 Oct 2018 07:31:52 +0000 (15:31 +0800)
committerXiao Jin <jin.xiao@samsung.com>
Thu, 25 Oct 2018 07:43:45 +0000 (15:43 +0800)
Change-Id: I60371435659af6c99e1e4c00fddad2a867a48b89

cases/create/mixed_cases/mic_cr_check_env.case [new file with mode: 0755]
fixtures/ks_files/env_section.ks [new file with mode: 0755]

diff --git a/cases/create/mixed_cases/mic_cr_check_env.case b/cases/create/mixed_cases/mic_cr_check_env.case
new file mode 100755 (executable)
index 0000000..b07ada2
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary>check if env is right</summary>
+  <fixtures>
+    <copy src="ks_files/env_section.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+loop_used_before=$(sudo $losetup_path -a | wc -l)
+sudo mic -d -v cr loop env_section.ks --logfile=mic.log
+grep 'Finished' mic.log
+grep 'VALUE1 = 0x1000' mic.log
+grep 'VALUE2 = "value"' mic.log
+test -e mic-output/platform.img
+sudo $losetup_path -a
+loop_used_after=$(sudo $losetup_path -a | wc -l)
+if [ "$loop_used_before" -ne "$loop_used_after" ];then
+    echo "Number of loop devices is not the same with previous number."
+    exit 1
+fi
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output
+test -f mic.log && sudo rm mic.log
+echo 'finish cleaning'
+]]></teardown>
+</testcase>
diff --git a/fixtures/ks_files/env_section.ks b/fixtures/ks_files/env_section.ks
new file mode 100755 (executable)
index 0000000..d34be17
--- /dev/null
@@ -0,0 +1,25 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 848 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen
+bootloader  --timeout=0  --append="rootdelay=5 security=none"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-base --baseurl=http://10.113.136.109/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main --baseurl=http://10.113.136.109/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+
+%env
+VALUE1=0x1000
+VALUE2="value"
+%end
+
+%packages
+bash
+%end