Files
xen/tools/xenstore/testsuite/08transaction.test
T
kaf24@firebug.cl.cam.ac.uk 4657d174ab Refactor xenbus to break up the xenbus_lock and permit watches
to fire concurrently with request/reply pairs. Remove
watch_ack message: no longer needed.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-09 18:52:54 +01:00

93 lines
1.5 KiB
Plaintext

# Test transactions.
mkdir /test
# Simple transaction: create a file inside transaction.
1 start
1 write /test/entry1 contents
2 dir /test
expect 1:entry1
1 dir /test
1 commit
expect 2:contents
2 read /test/entry1
rm /test/entry1
# Create a file and abort transaction.
1 start
1 write /test/entry1 contents
2 dir /test
expect 1:entry1
1 dir /test
1 abort
2 dir /test
write /test/entry1 contents
# Delete in transaction, commit
1 start
1 rm /test/entry1
expect 2:entry1
2 dir /test
1 dir /test
1 commit
2 dir /test
# Delete in transaction, abort.
write /test/entry1 contents
1 start
1 rm /test/entry1
expect 2:entry1
2 dir /test
1 dir /test
1 abort
expect 2:entry1
2 dir /test
# Events inside transactions don't trigger watches until (successful) commit.
mkdir /test/dir
1 watch /test token
2 start
2 mkdir /test/dir/sub
expect 1: waitwatch failed: Connection timed out
1 waitwatch
2 close
1 close
1 watch /test token
2 start
2 mkdir /test/dir/sub
2 abort
expect 1: waitwatch failed: Connection timed out
1 waitwatch
1 close
1 watch /test token
2 start
2 mkdir /test/dir/sub
2 commit
expect 1:/test/dir/sub:token
1 waitwatch
1 close
# Rm inside transaction works like rm outside: children get notified.
1 watch /test/dir/sub token
2 start
2 rm /test/dir
2 commit
expect 1:/test/dir/sub:token
1 waitwatch
1 close
# Multiple events from single transaction don't trigger assert
1 watch /test token
2 start
2 write /test/1 contents
2 write /test/2 contents
2 commit
expect 1:/test/1:token
1 waitwatch
expect 1:/test/2:token
1 waitwatch
1 close