Don't check the files by using mic chroot method
[tools/itest-cases-mic.git] / cases / create / opt_cases / mic_cr_raw_compress-image-lzo_native_ia32.case
1 <testcase>
2   <summary>create raw image with ia32 arch and compress-image option with lzo</summary>
3   <fixtures>
4     <copy src="ks_files/ivi.ks" />
5     <copy src="scripts/compute_volume.sh" />
6   </fixtures>
7   <steps><![CDATA[
8 losetup_path=$(sudo which losetup)
9 sudo $losetup_path -a
10 sudo $losetup_path -a | wc -l | xargs test 0 -eq
11 if ! which lzop; then
12     sudo spm install lzop
13 fi
14 sudo mic cr raw ivi.ks -o out1 -d -v --logfile=mic1.log --runtime=native
15 grep 'Finished' mic1.log
16 test -f ./out1/ivi*.raw
17 sudo $losetup_path -a
18 sudo $losetup_path -a | wc -l | xargs test 0 -eq
19 sudo mic cr raw ivi.ks --compress-image=lzo -o out2 -d -v --logfile=mic2.log --runtime=native
20 grep 'Finished' mic2.log
21 test -e ./out2/ivi*.raw.lzo
22 sudo $losetup_path -a
23 sudo $losetup_path -a | wc -l | xargs test 0 -eq
24 source compute_volume.sh
25 cd out1
26 name1=`ls ivi*.raw`
27 p1=`compute_volume $name1`
28 cd ../out2
29 name2=`ls ivi*.raw.lzo`
30 p2=`compute_volume $name2`
31 result=`awk -v before_volume=$p1 -v compress_volume=$p2 'BEGIN {print(before_volume>compress_volume)?"yes":"no"}'`
32 test $result = 'yes'
33 sudo lzop -x $name2
34 raw_name=`ls ivi*.raw`
35 test -e $name
36 ]]></steps>
37   <teardown><![CDATA[
38 echo "cleaning..."
39 sudo rm -rf ./out1/ ./out2/
40 sudo rm mic1.log mic2.log
41 ]]></teardown>
42 </testcase>