]> git.ozlabs.org Git - petitboot/blob - test/parser-test.sh
Add hotplug test script
[petitboot] / test / parser-test.sh
1 #!/bin/bash
2
3 testdir=devices/parser-tests
4 default_rootdev=ps3da1
5
6 function test_dir()
7 {
8         dir="$1"
9         rootdev=$default_rootdev
10         if [ -e "$dir/rootdev" ]
11         then
12                 rootdev=$(cat "$dir/rootdev")
13         fi
14         ./parser-test "$dir" /dev/$rootdev 2>/dev/null |
15                 diff -u "$dir/expected-output" -
16 }
17
18 set -ex
19
20 for test in $testdir/*
21 do
22         echo $test
23         test_dir "$test"
24 done
25
26 echo "All tests passed"