source: trunk/packages/xen-3.1/xen-3.1/tools/xenstore/testsuite/08transaction.test @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 1.5 KB
Line 
1# Test transactions.
2
3mkdir /test
4
5# Simple transaction: create a file inside transaction.
61 start
71 write /test/entry1 contents
82 dir /test
9expect 1:entry1
101 dir /test
111 commit
12expect 2:contents
132 read /test/entry1
14
15rm /test/entry1
16
17# Create a file and abort transaction.
181 start
191 write /test/entry1 contents
202 dir /test
21expect 1:entry1
221 dir /test
231 abort
242 dir /test
25
26write /test/entry1 contents
27# Delete in transaction, commit
281 start
291 rm /test/entry1
30expect 2:entry1
312 dir /test
321 dir /test
331 commit
342 dir /test
35
36# Delete in transaction, abort.
37write /test/entry1 contents
381 start
391 rm /test/entry1
40expect 2:entry1
412 dir /test
421 dir /test
431 abort
44expect 2:entry1
452 dir /test
46
47# Events inside transactions don't trigger watches until (successful) commit.
48mkdir /test/dir
491 watch /test token
502 start
512 mkdir /test/dir/sub
52expect 1: waitwatch failed: Connection timed out
531 waitwatch
542 close
551 close
56
571 watch /test token
582 start
592 mkdir /test/dir/sub
602 abort
61expect 1: waitwatch failed: Connection timed out
621 waitwatch
631 close
64
651 watch /test token
662 start
672 mkdir /test/dir/sub
682 commit
69expect 1:/test/dir/sub:token
701 waitwatch
711 close
72
73# Rm inside transaction works like rm outside: children get notified.
741 watch /test/dir/sub token
752 start
762 rm /test/dir
772 commit
78expect 1:/test/dir/sub:token
791 waitwatch
801 close
81
82# Multiple events from single transaction don't trigger assert
831 watch /test token
842 start
852 write /test/1 contents
862 write /test/2 contents
872 commit
88expect 1:/test/1:token
891 waitwatch
90expect 1:/test/2:token
911 waitwatch
921 close
Note: See TracBrowser for help on using the repository browser.