-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtest.sh
executable file
·37 lines (30 loc) · 987 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# Mount filesystem
mkdir -p mnt/
./xmlfs mnt/ -o xmlfile=test.xml
# Do basic tests
cd mnt/
if [ `find 1.root/ -name '*.node' | wc -l` -ne 2 ]; then
echo "Too many %d.nodes in 1.root";
fi
if [ `find 1.root/1.node/ -name 'attribute' | wc -l` -ne 1 ]; then
echo "attribute error in 1.root/1.node/";
fi
if [ `find 1.root/1.node/ -name 'attribute2' | wc -l` -ne 0 ]; then
echo "attribute2 should not be in 1.root/1.node";
fi
if [ `cat 1.root/1.node/attribute` != "attrib_value" ]; then
echo "1.root/1.node/attribute does not contain 'attrib_value'";
fi
if [ `find 1.root/2.node/ -name 'attribute' | wc -l` -ne 0 ]; then
echo "attribute should not be in 1.root/1.node/";
fi
if [ `find 1.root/2.node/ -name 'attribute2' | wc -l` -ne 1 ]; then
echo "attribute2 error in 1.root/1.node";
fi
if [ "`cat 1.root/1.textcontent/#text`" != "some text" ]; then
echo "Failed to read 1.root/1.textcontent/#text properly";
fi
cd ..
fusermount -u mnt
echo "Done"