# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID f9a3f32a129bdbfed70273d333cbac9dd8c99b83
# Parent 71271a3f41a932f44a3b7cee8e2b46a760d8cfe2
Fix testsuite to ignore tool/ dir.
Signed-off-by: Rusty Russel <rusty@xxxxxxxxxxxxxxx>
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
diff -r 71271a3f41a9 -r f9a3f32a129b tools/xenstore/Makefile
--- a/tools/xenstore/Makefile Tue Jul 26 14:02:33 2005
+++ b/tools/xenstore/Makefile Tue Jul 26 15:08:22 2005
@@ -86,9 +86,9 @@
$(TESTENV) ./xs_random --fail /tmp/xs_random 10000 $(RANDSEED)
stresstest: xs_stress xs_watch_stress xenstored_test
- rm -rf $(TESTDIR)/store
+ rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
export $(TESTENV); PID=`./xenstored_test --output-pid
--trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
- rm -rf $(TESTDIR)/store
+ rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
export $(TESTENV); PID=`./xenstored_test --output-pid`;
./xs_watch_stress; ret=$$?; kill $$PID; exit $$ret
xs_dom0_test: xs_dom0_test.o utils.o
diff -r 71271a3f41a9 -r f9a3f32a129b tools/xenstore/testsuite/02directory.sh
--- a/tools/xenstore/testsuite/02directory.sh Tue Jul 26 14:02:33 2005
+++ b/tools/xenstore/testsuite/02directory.sh Tue Jul 26 15:08:22 2005
@@ -1,22 +1,23 @@
#! /bin/sh
-# Root directory has nothing in it.
-[ "`echo -e 'dir /' | ./xs_test 2>&1`" = "" ]
+# Root directory has only tool dir in it.
+[ "`echo -e 'dir /' | ./xs_test 2>&1`" = "tool" ]
# Create a file.
[ "`echo -e 'write /test create contents' | ./xs_test 2>&1`" = "" ]
# Directory shows it.
-[ "`echo -e 'dir /' | ./xs_test 2>&1`" = "test" ]
+[ "`echo -e 'dir /' | ./xs_test 2>&1 | sort`" = "test
+tool" ]
# Make a new directory.
[ "`echo -e 'mkdir /dir' | ./xs_test 2>&1`" = "" ]
# Check it's there.
-DIR="`echo -e 'dir /' | ./xs_test 2>&1`"
-[ "$DIR" = "test
-dir" ] || [ "$DIR" = "dir
-test" ]
+DIR="`echo -e 'dir /' | ./xs_test 2>&1 | sort`"
+[ "$DIR" = "dir
+test
+tool" ]
# Check it's empty.
[ "`echo -e 'dir /dir' | ./xs_test 2>&1`" = "" ]
diff -r 71271a3f41a9 -r f9a3f32a129b tools/xenstore/testsuite/08transaction.sh
--- a/tools/xenstore/testsuite/08transaction.sh Tue Jul 26 14:02:33 2005
+++ b/tools/xenstore/testsuite/08transaction.sh Tue Jul 26 15:08:22 2005
@@ -1,79 +1,81 @@
#! /bin/sh
# Test transactions.
+echo mkdir /test | ./xs_test
+
# Simple transaction: create a file inside transaction.
-[ "`echo -e '1 start /
-1 write /entry1 create contents
-2 dir /
-1 dir /
+[ "`echo -e '1 start /test
+1 write /test/entry1 create contents
+2 dir /test
+1 dir /test
1 commit
-2 read /entry1' | ./xs_test`" = "1:entry1
+2 read /test/entry1' | ./xs_test`" = "1:entry1
2:contents" ]
-echo rm /entry1 | ./xs_test
+echo rm /test/entry1 | ./xs_test
# Create a file and abort transaction.
-[ "`echo -e '1 start /
-1 write /entry1 create contents
-2 dir /
-1 dir /
+[ "`echo -e '1 start /test
+1 write /test/entry1 create contents
+2 dir /test
+1 dir /test
1 abort
-2 dir /' | ./xs_test`" = "1:entry1" ]
+2 dir /test' | ./xs_test`" = "1:entry1" ]
-echo write /entry1 create contents | ./xs_test
+echo write /test/entry1 create contents | ./xs_test
# Delete in transaction, commit
-[ "`echo -e '1 start /
-1 rm /entry1
-2 dir /
-1 dir /
+[ "`echo -e '1 start /test
+1 rm /test/entry1
+2 dir /test
+1 dir /test
1 commit
-2 dir /' | ./xs_test`" = "2:entry1" ]
+2 dir /test' | ./xs_test`" = "2:entry1" ]
# Delete in transaction, abort.
-echo write /entry1 create contents | ./xs_test
-[ "`echo -e '1 start /
-1 rm /entry1
-2 dir /
-1 dir /
+echo write /test/entry1 create contents | ./xs_test
+[ "`echo -e '1 start /test
+1 rm /test/entry1
+2 dir /test
+1 dir /test
1 abort
-2 dir /' | ./xs_test`" = "2:entry1
+2 dir /test' | ./xs_test`" = "2:entry1
2:entry1" ]
# Transactions can take as long as the want...
-[ "`echo -e 'start /
+[ "`echo -e 'start /test
sleep 1
-rm /entry1
+rm /test/entry1
commit
-dir /' | ./xs_test`" = "" ]
+dir /test' | ./xs_test`" = "" ]
# ... as long as noone is waiting.
-[ "`echo -e '1 start /
-2 mkdir /dir
-1 mkdir /dir
-1 dir /
+[ "`echo -e '1 start /test
+2 mkdir /test/dir
+1 mkdir /test/dir
+1 dir /test
1 commit' | ./xs_test 2>&1`" = "1:dir
FATAL: 1: commit: Connection timed out" ]
# Events inside transactions don't trigger watches until (successful) commit.
-[ "`echo -e '1 watch / token 100
-2 start /
-2 mkdir /dir/sub
+[ "`echo -e '1 watch /test token 100
+2 start /test
+2 mkdir /test/dir/sub
1 waitwatch' | ./xs_test 2>&1`" = "1:waitwatch timeout" ]
-[ "`echo -e '1 watch / token 100
-2 start /
-2 mkdir /dir/sub
+[ "`echo -e '1 watch /test token 100
+2 start /test
+2 mkdir /test/dir/sub
2 abort
1 waitwatch' | ./xs_test 2>&1`" = "1:waitwatch timeout" ]
-[ "`echo -e '1 watch / token 100
-2 start /
-2 mkdir /dir/sub
+[ "`echo -e '1 watch /test token 100
+2 start /test
+2 mkdir /test/dir/sub
2 commit
1 waitwatch
-1 ackwatch token' | ./xs_test 2>&1`" = "1:/dir/sub:token" ]
+1 ackwatch token' | ./xs_test 2>&1`" = "1:/test/dir/sub:token" ]
# Rm inside transaction works like rm outside: children get notified.
-[ "`echo -e '1 watch /dir/sub token 100
-2 start /
-2 rm /dir
+[ "`echo -e '1 watch /test/dir/sub token 100
+2 start /test
+2 rm /test/dir
2 commit
1 waitwatch
-1 ackwatch token' | ./xs_test 2>&1`" = "1:/dir/sub:token" ]
+1 ackwatch token' | ./xs_test 2>&1`" = "1:/test/dir/sub:token" ]
diff -r 71271a3f41a9 -r f9a3f32a129b tools/xenstore/testsuite/09domain.sh
--- a/tools/xenstore/testsuite/09domain.sh Tue Jul 26 14:02:33 2005
+++ b/tools/xenstore/testsuite/09domain.sh Tue Jul 26 15:08:22 2005
@@ -4,8 +4,9 @@
# Create a domain, write an entry.
[ "`echo -e 'introduce 1 100 7 /my/home
1 write /entry1 create contents
-dir /' | ./xs_test 2>&1`" = "handle is 1
-entry1" ]
+dir /' | ./xs_test 2>&1 | sort`" = "entry1
+handle is 1
+tool" ]
# Release that domain.
[ "`echo -e 'release 1' | ./xs_test`" = "" ]
diff -r 71271a3f41a9 -r f9a3f32a129b tools/xenstore/testsuite/12readonly.sh
--- a/tools/xenstore/testsuite/12readonly.sh Tue Jul 26 14:02:33 2005
+++ b/tools/xenstore/testsuite/12readonly.sh Tue Jul 26 15:08:22 2005
@@ -4,16 +4,17 @@
[ "`echo 'write /test create contents' | ./xs_test 2>&1`" = "" ]
# These are all valid.
-[ "`echo 'dir /
-read /test
+[ "`echo dir / | ./xs_test --readonly 2>&1 | sort`" = "test
+tool" ]
+
+[ "`echo 'read /test
getperm /test
watch /test token 0
unwatch /test token
start /
commit
start /
-abort' | ./xs_test --readonly 2>&1`" = "test
-contents
+abort' | ./xs_test --readonly 2>&1`" = "contents
0 READ" ]
# These don't work
diff -r 71271a3f41a9 -r f9a3f32a129b tools/xenstore/xs_random.c
--- a/tools/xenstore/xs_random.c Tue Jul 26 14:02:33 2005
+++ b/tools/xenstore/xs_random.c Tue Jul 26 15:08:22 2005
@@ -987,6 +987,8 @@
char *cmd = talloc_asprintf(NULL, "echo -n r0 > %s/.perms", dir);
if (mkdir(dir, 0700) != 0)
barf_perror("Creating directory %s", dir);
+ if (mkdir(talloc_asprintf(cmd, "%s/tool", dir), 0700) != 0)
+ barf_perror("Creating directory %s/tool", dir);
do_command(cmd);
talloc_free(cmd);
}
@@ -1211,6 +1213,10 @@
char *nodename;
bool ret = false;
+ /* Ignore tool/ dir. */
+ if (streq(node, "/tool"))
+ return true;
+
/* FILE backend expects talloc'ed pointer. */
nodename = talloc_strdup(NULL, node);
permsa = a->get_perms(ah, nodename, &numpermsa);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|