Don't check the files by using mic chroot method
[tools/itest-cases-mic.git] / cases / create / opt_cases / mic_cr_auto_liveusb.case
1 <testcase>
2   <summary>test 'mic cr auto ks' for liveusb type
3 if we run command with 'auto', mic will use the first line in ks file, which called magic line, and
4 magic line in this ks file is:
5  -*-mic2-options-*- -f liveusb --copy-kernel --pack-to=@NAME@-rs.zip -*-mic2-options-*-</summary>
6   <fixtures>
7     <copy src="ks_files/gnome-live.ks" />
8     <content target="parse_manifest.py">
9 import sys
10 import json
11 img_file = sys.argv[1]
12 mic_version = sys.argv[2]
13 manifest_file=open('mic-output/manifest.json')
14 manifest=json.load(manifest_file)
15 assert manifest['format'] == 'liveusb'
16 assert manifest['version'] == mic_version
17 assert manifest['liveusb']['pack'] == '.zip'
18 assert img_file in manifest['liveusb']['image_files']
19     </content>
20   </fixtures>
21   <conditions>
22    <blacklist>
23     <platform>ubuntu14.10</platform>
24    </blacklist>
25   </conditions>
26   <steps><![CDATA[
27 losetup_path=$(sudo which losetup)
28 sudo $losetup_path -a
29 sudo $losetup_path -a | wc -l | xargs test 0 -eq
30 sudo mic cr -d -v  auto gnome-live.ks --logfile=log.file --runtime=native
31 grep "Finished" log.file
32 sudo $losetup_path -a
33 sudo $losetup_path -a | wc -l | xargs test 0 -eq
34 liveusb_img=$(ls mic-output/ | grep 'gnome-live-.*-rs.zip')
35 ls mic-output/ | grep 'gnome-live-.*-vmlinuz-.*'
36 mic_version=$(mic --version | awk '{print $2}')
37 python parse_manifest.py $liveusb_img $mic_version
38 ]]></steps>
39   <teardown><![CDATA[
40 echo "cleaning..."
41 test -d ./mic-output && sudo rm -rf mic-output
42 ]]></teardown>
43 </testcase>