From: Dan Smith Subject: [PATCH][XM-TEST] Add a test for the last bit of bug #416 Date: Wed, 30 Nov 2005 12:22:55 -0800 Message-ID: <871x0xj36o.fsf@theine.beaverton.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen Developers List-Id: xen-devel@lists.xenproject.org --=-=-= This patch adds a test to verify that removed devices disappear from the "xm list --long" output. Signed-off-by: Dan Smith --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=long_list_devices_test.patch # HG changeset patch # User dan@localhost.localdomain # Node ID 73ff11c5982a1423e1ca86a19ddb6b4717bf6739 # Parent 37c09b20a89678e3b3aed292fc0be10ed44bac44 Add test for the last unresolved bit of bug #416. Check that "xm list --long" reflects removed devices. diff -r 37c09b20a896 -r 73ff11c5982a tools/xm-test/tests/block-destroy/Makefile.am --- a/tools/xm-test/tests/block-destroy/Makefile.am Wed Nov 30 11:51:24 2005 +++ b/tools/xm-test/tests/block-destroy/Makefile.am Wed Nov 30 20:21:06 2005 @@ -5,7 +5,8 @@ 02_block-destroy_rtblock_pos.test \ 03_block-destroy_nonexist_neg.test \ 04_block-destroy_nonattached_neg.test \ - 05_block-destroy_byname_pos.test + 05_block-destroy_byname_pos.test \ + 06_block-destroy_check_list_pos.test XFAIL_TESTS = diff -r 37c09b20a896 -r 73ff11c5982a tools/xm-test/tests/block-destroy/06_block-destroy_check_list_pos.py --- /dev/null Wed Nov 30 11:51:24 2005 +++ b/tools/xm-test/tests/block-destroy/06_block-destroy_check_list_pos.py Wed Nov 30 20:21:06 2005 @@ -0,0 +1,58 @@ +#!/usr/bin/python + +# Copyright (C) International Business Machines Corp., 2005 +# Author: Dan Smith + +from XmTestLib import * + +import time +import re + +def checkBlockList(domain): + s, o = traceCommand("xm block-list %s" % domain.getName()) + if s != 0: + FAIL("block-list failed") + if re.search("769", o): + return True + else: + return False + +def checkXmLongList(domain): + s, o = traceCommand("xm list --long %s" % domain.getName()) + if s != 0: + FAIL("xm list --long failed") + if re.search("hda1", o): + return True + else: + return False + +domain = XmTestDomain() + +try: + domain.start() +except DomainError,e: + FAIL(str(e)) + +s, o = traceCommand("xm block-attach %s phy:/dev/ram0 hda1 w" % domain.getName()) +if s != 0: + FAIL("block-attach failed") + +if not checkBlockList(domain): + FAIL("block-list does not show that hda1 was attached") + +if not checkXmLongList(domain): + FAIL("xm long list does not show that hda1 was attached") + +s, o = traceCommand("xm block-detach %s hda1" % domain.getName()) +if s != 0: + FAIL("block-detach failed") + +time.sleep(2) + +if checkBlockList(domain): + FAIL("block-list does not show that hda1 was removed") + +if checkXmLongList(domain): + FAIL("xm long list does not show that hda1 was removed") + + --=-=-= -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-=-=--