X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=test%2Fparser-test.sh;h=af54395215ed57d754ea33614881aedc7aa05fbb;hp=140601e70ad7de5cea7f6395931616cbbf11aaf5;hb=66a74150f8723faf997fc6d4c58bd9bb23c3c2e6;hpb=32e6a41f33e5576716b351bd473a27939fe94fa1 diff --git a/test/parser-test.sh b/test/parser-test.sh index 140601e..af54395 100755 --- a/test/parser-test.sh +++ b/test/parser-test.sh @@ -1,26 +1,25 @@ #!/bin/bash -testdir=devices/parser-tests +testdir=parser default_rootdev=ps3da1 +mnt=${PREFIX}/var/petitboot/mnt -function test_dir() -{ - dir="$1" +#set -ex + +tests=$(ls ${mnt}/${testdir}/) + +for test in $tests +do rootdev=$default_rootdev - if [ -e "$dir/rootdev" ] - then - rootdev=$(cat "$dir/rootdev") + + if [ -e "${mnt}/${testdir}/$test/rootdev" ]; then + rootdev=$(cat "${mnt}/${testdir}/$test/rootdev") fi - ./parser-test "$dir" /dev/$rootdev 2>/dev/null | - diff -u "$dir/expected-output" - -} -set -ex + ./test/parser-test "${testdir}/$test" $rootdev -for test in $testdir/* -do - echo $test - test_dir "$test" +# ./test/parser-test "${testdir}/$test" $rootdev 2>/dev/null | +# diff -u "${mnt}/${testdir}/$test/expected-output" - done echo "All tests passed"