[sheepdog] [PATCH v2 3/3] tests/functional: make a result of vdi list deterministic with sort

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Tue Aug 27 14:35:37 CEST 2013


The previous patch in this series make parse_vdi() parallel, and also
make an output of dog vdi list non-deterministic. This breaks
tests/functional.

This patch make a result of vdi list deterministic with sort command.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 tests/functional/029.out   |    4 ++--
 tests/functional/030.out   |   16 ++++++++--------
 tests/functional/031.out   |    4 ++--
 tests/functional/039.out   |   10 +++++-----
 tests/functional/041.out   |   10 +++++-----
 tests/functional/046.out   |    4 ++--
 tests/functional/060.out   |   32 ++++++++++++++++----------------
 tests/functional/common.rc |    2 +-
 8 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/tests/functional/029.out b/tests/functional/029.out
index 2269ebc..88e0c81 100644
--- a/tests/functional/029.out
+++ b/tests/functional/029.out
@@ -1,9 +1,9 @@
 QA output created by 029
 using backend plain store
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
-  test4        0   20 MB   20 MB  0.0 MB DATE   fd2de3     4              
-  test3        0   20 MB   20 MB  0.0 MB DATE   fd3662     3              
   test2        0   20 MB  0.0 MB   20 MB DATE   fd3816     2              
+  test3        0   20 MB   20 MB  0.0 MB DATE   fd3662     3              
+  test4        0   20 MB   20 MB  0.0 MB DATE   fd2de3     4              
 Looking for the object 0xfd381500000001 (the inode vid 0xfd3816 idx 1) with 7 nodes
 
 127.0.0.1:7000 doesn't have the object
diff --git a/tests/functional/030.out b/tests/functional/030.out
index 09a32a8..9c542c7 100644
--- a/tests/functional/030.out
+++ b/tests/functional/030.out
@@ -6,32 +6,32 @@ Index		Tag		Snapshot Time
 1		s1		DATE
 2		s2		DATE
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test1        0   10 MB  0.0 MB   12 MB DATE   fd32fe     3              
+  test2        0   10 MB  0.0 MB   12 MB DATE   fd3817     3              
 s test1        1   10 MB   12 MB  0.0 MB DATE   fd32fc     3              
 s test1        2   10 MB   12 MB  0.0 MB DATE   fd32fd     3              
-  test1        0   10 MB  0.0 MB   12 MB DATE   fd32fe     3              
 s test2        1   10 MB   12 MB  0.0 MB DATE   fd3815     3              
 s test2        2   10 MB   12 MB  0.0 MB DATE   fd3816     3              
-  test2        0   10 MB  0.0 MB   12 MB DATE   fd3817     3              
 using backend plain store
 using backend plain store
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
-s test1        1   10 MB   12 MB  0.0 MB DATE   fd32fc     3              
   test1        0   10 MB  0.0 MB   12 MB DATE   fd32fd     3              
-s test2        1   10 MB   12 MB  0.0 MB DATE   fd3815     3              
   test2        0   10 MB  0.0 MB   12 MB DATE   fd3816     3              
+s test1        1   10 MB   12 MB  0.0 MB DATE   fd32fc     3              
+s test2        1   10 MB   12 MB  0.0 MB DATE   fd3815     3              
 using backend plain store
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test1        0   10 MB  0.0 MB   12 MB DATE   fd32fe     3              
+  test2        0   10 MB  0.0 MB   12 MB DATE   fd3817     3              
 s test1        1   10 MB   12 MB  0.0 MB DATE   fd32fc     3              
 s test1        2   10 MB   12 MB  0.0 MB DATE   fd32fd     3              
-  test1        0   10 MB  0.0 MB   12 MB DATE   fd32fe     3              
 s test2        1   10 MB   12 MB  0.0 MB DATE   fd3815     3              
 s test2        2   10 MB   12 MB  0.0 MB DATE   fd3816     3              
-  test2        0   10 MB  0.0 MB   12 MB DATE   fd3817     3              
 using backend plain store
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test1        0   10 MB  0.0 MB   12 MB DATE   fd32fe     3              
+  test2        0   10 MB  0.0 MB   12 MB DATE   fd3817     3              
 s test1        1   10 MB   12 MB  0.0 MB DATE   fd32fc     3              
 s test1        2   10 MB   12 MB  0.0 MB DATE   fd32fd     3              
-  test1        0   10 MB  0.0 MB   12 MB DATE   fd32fe     3              
 s test2        1   10 MB   12 MB  0.0 MB DATE   fd3815     3              
 s test2        2   10 MB   12 MB  0.0 MB DATE   fd3816     3              
-  test2        0   10 MB  0.0 MB   12 MB DATE   fd3817     3              
diff --git a/tests/functional/031.out b/tests/functional/031.out
index 4c66cff..a1f2f19 100644
--- a/tests/functional/031.out
+++ b/tests/functional/031.out
@@ -2,9 +2,9 @@ QA output created by 031
 using backend plain store
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
   test1        0  100 MB  0.0 MB  0.0 MB DATE   fd32fc     1              
-  test3        0  300 MB  0.0 MB  0.0 MB DATE   fd3662     1              
   test2        0  200 MB  0.0 MB  0.0 MB DATE   fd3815     1              
+  test3        0  300 MB  0.0 MB  0.0 MB DATE   fd3662     1              
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
   test1        0  100 MB  0.0 MB  0.0 MB DATE   fd32fc     1              
-  test3        0  300 MB  0.0 MB  0.0 MB DATE   fd3662     1              
   test2        0  200 MB  0.0 MB  0.0 MB DATE   fd3815     1              
+  test3        0  300 MB  0.0 MB  0.0 MB DATE   fd3662     1              
diff --git a/tests/functional/039.out b/tests/functional/039.out
index 6d1a1aa..f457c53 100644
--- a/tests/functional/039.out
+++ b/tests/functional/039.out
@@ -9,8 +9,8 @@ snapshot was taken.  Continue? [yes/no]: read 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 test---[DATE]---(you are here)
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
-s test         1  4.0 GB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
   test         0  4.0 GB  0.0 MB  4.0 MB DATE   7c2b26     3              
+s test         1  4.0 GB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
 wrote 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 512/512 bytes at offset 0
@@ -21,26 +21,26 @@ snapshot was taken.  Continue? [yes/no]: read 512/512 bytes at offset 0
 test---[DATE]-+-[DATE]
                           `-(you are here)
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         0  4.0 GB  0.0 MB  4.0 MB DATE   7c2b27     3              
 s test         1  4.0 GB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
 s test         2  4.0 GB  4.0 MB  0.0 MB DATE   7c2b26     3         snap2
-  test         0  4.0 GB  0.0 MB  4.0 MB DATE   7c2b27     3              
 This operation dicards any changes made since the previous
 snapshot was taken.  Continue? [yes/no]: read 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 test---[DATE]---[DATE]---(you are here)
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         0  4.0 GB  0.0 MB  4.0 MB DATE   7c2b27     3              
 s test         1  4.0 GB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
 s test         2  4.0 GB  4.0 MB  0.0 MB DATE   7c2b26     3         snap2
-  test         0  4.0 GB  0.0 MB  4.0 MB DATE   7c2b27     3              
 This operation dicards any changes made since the previous
 snapshot was taken.  Continue? [yes/no]: read 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 test---[DATE]-+-[DATE]
                           `-(you are here)
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         0  4.0 GB  0.0 MB  4.0 MB DATE   7c2b27     3              
 s test         1  4.0 GB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
 s test         2  4.0 GB  4.0 MB  0.0 MB DATE   7c2b26     3         snap2
-  test         0  4.0 GB  0.0 MB  4.0 MB DATE   7c2b27     3              
 wrote 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 512/512 bytes at offset 0
@@ -55,8 +55,8 @@ test---[DATE]-+-[DATE]
                           `-[DATE]-+-[DATE]
                                                `-(you are here)
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         0  4.0 GB  0.0 MB  4.0 MB DATE   7c2b29     3              
 s test         1  4.0 GB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
 s test         2  4.0 GB  4.0 MB  0.0 MB DATE   7c2b26     3         snap2
 s test         3  4.0 GB  4.0 MB  0.0 MB DATE   7c2b27     3         snap3
 s test         4  4.0 GB  4.0 MB  0.0 MB DATE   7c2b28     3         snap4
-  test         0  4.0 GB  0.0 MB  4.0 MB DATE   7c2b29     3              
diff --git a/tests/functional/041.out b/tests/functional/041.out
index 7e1316e..f843608 100644
--- a/tests/functional/041.out
+++ b/tests/functional/041.out
@@ -1,43 +1,44 @@
 QA output created by 041
 using backend plain store
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         0   12 MB  0.0 MB  8.0 MB DATE   7c2b28     3              
 s test         1   12 MB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
 s test         2   12 MB  4.0 MB  4.0 MB DATE   7c2b26     3         snap2
 s test         3   12 MB  4.0 MB  4.0 MB DATE   7c2b27     3         snap3
-  test         0   12 MB  0.0 MB  8.0 MB DATE   7c2b28     3              
 test---[DATE]---[DATE]---[DATE]---(you are here)
 b6338c1861851820f8d289c3b4e6443c  -
 1885611ba75e996f619e8eaf136366e6  -
 d210baf5c55b42b5e0edf04a8535ad6d  -
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         0   12 MB  0.0 MB  8.0 MB DATE   7c2b29     3              
 s test         1   12 MB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
 s test         2   12 MB  4.0 MB  4.0 MB DATE   7c2b26     3         snap2
 s test         3   12 MB  4.0 MB  4.0 MB DATE   7c2b27     3         snap3
 s test         4   12 MB  4.0 MB  4.0 MB DATE   7c2b28     3              
-  test         0   12 MB  0.0 MB  8.0 MB DATE   7c2b29     3              
 test---[DATE]-+-[DATE]---[DATE]---(you are here)
                           `-[DATE]
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         0   12 MB  0.0 MB  8.0 MB DATE   7c2b2a     3              
 s test         1   12 MB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
 s test         2   12 MB  4.0 MB  4.0 MB DATE   7c2b26     3         snap2
 s test         3   12 MB  4.0 MB  4.0 MB DATE   7c2b27     3         snap3
 s test         4   12 MB  4.0 MB  4.0 MB DATE   7c2b28     3              
 s test         5   12 MB  4.0 MB  4.0 MB DATE   7c2b29     3              
-  test         0   12 MB  0.0 MB  8.0 MB DATE   7c2b2a     3              
 test---[DATE]-+-[DATE]---[DATE]---(you are here)
                           `-[DATE]---[DATE]
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         0   12 MB  0.0 MB  8.0 MB DATE   7c2b2b     3              
 s test         1   12 MB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
 s test         2   12 MB  4.0 MB  4.0 MB DATE   7c2b26     3         snap2
 s test         3   12 MB  4.0 MB  4.0 MB DATE   7c2b27     3         snap3
 s test         4   12 MB  4.0 MB  4.0 MB DATE   7c2b28     3              
 s test         5   12 MB  4.0 MB  4.0 MB DATE   7c2b29     3              
 s test         6   12 MB  8.0 MB  0.0 MB DATE   7c2b2a     3              
-  test         0   12 MB  0.0 MB  8.0 MB DATE   7c2b2b     3              
 test---[DATE]-+-[DATE]---[DATE]---(you are here)
                           |-[DATE]---[DATE]
                           `-[DATE]
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
+  test         0   12 MB  0.0 MB  8.0 MB DATE   7c2b2c     3              
 s test         1   12 MB  4.0 MB  0.0 MB DATE   7c2b25     3         snap1
 s test         2   12 MB  4.0 MB  4.0 MB DATE   7c2b26     3         snap2
 s test         3   12 MB  4.0 MB  4.0 MB DATE   7c2b27     3         snap3
@@ -45,7 +46,6 @@ s test         4   12 MB  4.0 MB  4.0 MB DATE   7c2b28     3
 s test         5   12 MB  4.0 MB  4.0 MB DATE   7c2b29     3              
 s test         6   12 MB  8.0 MB  0.0 MB DATE   7c2b2a     3              
 s test         7   12 MB  4.0 MB  4.0 MB DATE   7c2b2b     3              
-  test         0   12 MB  0.0 MB  8.0 MB DATE   7c2b2c     3              
 test---[DATE]-+-[DATE]-+-[DATE]---(you are here)
                           |                    `-[DATE]
                           |-[DATE]---[DATE]
diff --git a/tests/functional/046.out b/tests/functional/046.out
index 432b882..3d05034 100644
--- a/tests/functional/046.out
+++ b/tests/functional/046.out
@@ -2,8 +2,8 @@ QA output created by 046
 using backend plain store
 delete snapshot image before current one
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
-s test         1  4.0 GB  0.0 MB  0.0 MB DATE   7c2b25     2          snap
   test         0  4.0 GB  0.0 MB  0.0 MB DATE   7c2b26     2              
+s test         1  4.0 GB  0.0 MB  0.0 MB DATE   7c2b25     2          snap
 Cannot get VDI info for test 0 snap: Failed to find requested tag
 Failed to open VDI test
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
@@ -13,8 +13,8 @@ Failed to open VDI test
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
 delete current image before snapshot one
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
-s test         1  4.0 GB  0.0 MB  0.0 MB DATE   7c2b25     2          snap
   test         0  4.0 GB  0.0 MB  0.0 MB DATE   7c2b27     2              
+s test         1  4.0 GB  0.0 MB  0.0 MB DATE   7c2b25     2          snap
 Cannot get VDI info for test 0 : No VDI found
 Failed to open VDI test
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
diff --git a/tests/functional/060.out b/tests/functional/060.out
index 1bdd541..2ccde0a 100644
--- a/tests/functional/060.out
+++ b/tests/functional/060.out
@@ -5,73 +5,73 @@ fee603199c05d11ae60851eb95bbc5fb  -
 10040f8a44618b0764c5a73a12f58772  -
 7357bb73af7ab89d0083925863810ee3  -
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
-  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test0        0  100 MB  100 MB  0.0 MB DATE   fd34af     3              
-  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
+  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test2        0  100 MB  100 MB  0.0 MB DATE   fd3815     3              
+  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
 fb3833490ceb868a81ab0ba8bda8fdda  -
 fee603199c05d11ae60851eb95bbc5fb  -
 10040f8a44618b0764c5a73a12f58772  -
 7357bb73af7ab89d0083925863810ee3  -
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
-  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test0        0  100 MB  100 MB  0.0 MB DATE   fd34af     3              
-  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
+  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test2        0  100 MB  100 MB  0.0 MB DATE   fd3815     3              
+  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
 fb3833490ceb868a81ab0ba8bda8fdda  -
 fee603199c05d11ae60851eb95bbc5fb  -
 10040f8a44618b0764c5a73a12f58772  -
 7357bb73af7ab89d0083925863810ee3  -
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
-  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test0        0  100 MB  100 MB  0.0 MB DATE   fd34af     3              
-  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
+  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test2        0  100 MB  100 MB  0.0 MB DATE   fd3815     3              
+  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
 fb3833490ceb868a81ab0ba8bda8fdda  -
 fee603199c05d11ae60851eb95bbc5fb  -
 10040f8a44618b0764c5a73a12f58772  -
 7357bb73af7ab89d0083925863810ee3  -
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
-  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test0        0  100 MB  100 MB  0.0 MB DATE   fd34af     3              
-  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
+  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test2        0  100 MB  100 MB  0.0 MB DATE   fd3815     3              
+  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
 fb3833490ceb868a81ab0ba8bda8fdda  -
 fee603199c05d11ae60851eb95bbc5fb  -
 10040f8a44618b0764c5a73a12f58772  -
 7357bb73af7ab89d0083925863810ee3  -
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
-  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test0        0  100 MB  100 MB  0.0 MB DATE   fd34af     3              
-  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
+  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test2        0  100 MB  100 MB  0.0 MB DATE   fd3815     3              
+  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
 fb3833490ceb868a81ab0ba8bda8fdda  -
 fee603199c05d11ae60851eb95bbc5fb  -
 10040f8a44618b0764c5a73a12f58772  -
 7357bb73af7ab89d0083925863810ee3  -
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
-  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test0        0  100 MB  100 MB  0.0 MB DATE   fd34af     3              
-  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
+  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test2        0  100 MB  100 MB  0.0 MB DATE   fd3815     3              
+  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
 fb3833490ceb868a81ab0ba8bda8fdda  -
 fee603199c05d11ae60851eb95bbc5fb  -
 10040f8a44618b0764c5a73a12f58772  -
 7357bb73af7ab89d0083925863810ee3  -
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
-  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test0        0  100 MB  100 MB  0.0 MB DATE   fd34af     3              
-  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
+  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test2        0  100 MB  100 MB  0.0 MB DATE   fd3815     3              
+  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
 fb3833490ceb868a81ab0ba8bda8fdda  -
 fee603199c05d11ae60851eb95bbc5fb  -
 10040f8a44618b0764c5a73a12f58772  -
 7357bb73af7ab89d0083925863810ee3  -
   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
-  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test0        0  100 MB  100 MB  0.0 MB DATE   fd34af     3              
-  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
+  test1        0  100 MB  100 MB  0.0 MB DATE   fd32fc     3              
   test2        0  100 MB  100 MB  0.0 MB DATE   fd3815     3              
+  test3        0  100 MB  100 MB  0.0 MB DATE   fd3662     3              
 fb3833490ceb868a81ab0ba8bda8fdda  -
 fee603199c05d11ae60851eb95bbc5fb  -
 10040f8a44618b0764c5a73a12f58772  -
diff --git a/tests/functional/common.rc b/tests/functional/common.rc
index 2a64b53..dcf2f30 100644
--- a/tests/functional/common.rc
+++ b/tests/functional/common.rc
@@ -507,7 +507,7 @@ _kill_zk_session()
 _vdi_list()
 {
 	local args=$*
-	$DOG vdi list $args | _filter_short_date
+	$DOG vdi list $args | _filter_short_date | sort
 }
 
 # make sure this script returns success
-- 
1.7.10.4




More information about the sheepdog mailing list