Skip to contentSkip to conversation

Fix test 04_block_attach

PATCH Applied Dan Smith 2 participants 2 messages Nov 11, 2005 – Nov 12, 2005

lore
Share & tools
lore

Dan Smith

author
#0 lore raw

PATCH 1/1 Fix test 04_block_attach

Now that this test fails for the right reason, another bug is
revealed: #397.

# HG changeset patch
# User [email protected]
# Node ID 469dddcc907d0b79589c3e465cd59024acce9daf
# Parent e912f2e9b755bf8ce7d798867b3678759fa0df85
This test was failing for he wrong reason. Calls to block-attach after the first *should* report failure, so the test should not fail because of this. The test now fails because multiple calls to block-attach seem to detach the block devicem, which is wrong.

tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py +5 -3
diff -r e912f2e9b755 -r 469dddcc907d tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py
@@ -38,11 +38,13 @@
     
 for i in range(10):
 	status, output = traceCommand("xm block-attach %s phy:ram1 sdb1 w" % domain.getName())
-	if status != 0:
-        	FAIL("xm block-attach returned invalid %i != 0" % status)
+        if i == 0 and status != 0:
+            FAIL("xm block attach returned invalid %i != 0" % status)
+	if i > 0 and status == 0:
+            FAIL("xm block-attach (repeat) returned invalid %i > 0" % status)
 	run = console.runCmd("cat /proc/partitions")
 	if not re.search("sdb1", run['output']):
-		FAIL("Device is not actually attached to domU")
+            FAIL("Device is not actually attached to domU")
 
 # Close the console
 console.closeConsole()
Signature · 4 lines
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: [email protected]
Applied
#1 lore raw
Quoted 5 lines · Dan Smith

Now that this test fails for the right reason, another bug is
revealed: #397.

Quoted 8 lines

# HG changeset patch
# User [email protected]
# Node ID 469dddcc907d0b79589c3e465cd59024acce9daf
# Parent e912f2e9b755bf8ce7d798867b3678759fa0df85
This test was failing for he wrong reason. Calls to block-attach after the first *should* report failure, so the test should not fail because of this. The test now fails because multiple calls to block-attach seem to detach the block devicem, which is wrong.

Applied, thanks.

Ewan.