aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xm-test
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-07-30 16:03:16 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-07-30 16:03:16 +0100
commit9039ed2bed95843c9ee574e988f193432817596d (patch)
tree6556ef706e23c62d58b0a95a2d4c624c2720fe5b /tools/xm-test
parentcb2567cc912416c428deae9b7b07a08983c10785 (diff)
downloadxen-9039ed2bed95843c9ee574e988f193432817596d.tar.gz
xen-9039ed2bed95843c9ee574e988f193432817596d.tar.bz2
xen-9039ed2bed95843c9ee574e988f193432817596d.zip
[ACM] Some more fixes
- don't reload the policy if it has been loaded - don't always load the policy in the test suite when the policy is already loaded - skip tests 07 and 09 when ACM is not enabled and xm is not using the Xen-API - fix a problem when trying to remove an invalid label Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
Diffstat (limited to 'tools/xm-test')
-rw-r--r--tools/xm-test/lib/XmTestLib/acm.py4
-rw-r--r--tools/xm-test/tests/security-acm/07_security-acm_pol_update.py9
-rw-r--r--tools/xm-test/tests/security-acm/09_security-acm_pol_update.py9
3 files changed, 22 insertions, 0 deletions
diff --git a/tools/xm-test/lib/XmTestLib/acm.py b/tools/xm-test/lib/XmTestLib/acm.py
index dc9ab1611a..021aec048f 100644
--- a/tools/xm-test/lib/XmTestLib/acm.py
+++ b/tools/xm-test/lib/XmTestLib/acm.py
@@ -67,6 +67,10 @@ def ACMLoadPolicy(policy='xm-test'):
if main.serverType == main.SERVER_XEN_API:
ACMLoadPolicy_XenAPI()
else:
+ cmd='xm dumppolicy | grep -E "^POLICY REFERENCE = ' + policy + '.$"'
+ s, o = traceCommand(cmd)
+ if o != "":
+ return
s, o = traceCommand("xm makepolicy %s" % (policy))
if s != 0:
FAIL("Need to be able to do 'xm makepolicy %s' but could not" %
diff --git a/tools/xm-test/tests/security-acm/07_security-acm_pol_update.py b/tools/xm-test/tests/security-acm/07_security-acm_pol_update.py
index 8365842930..d4d5eafdf7 100644
--- a/tools/xm-test/tests/security-acm/07_security-acm_pol_update.py
+++ b/tools/xm-test/tests/security-acm/07_security-acm_pol_update.py
@@ -12,11 +12,20 @@ from xen.xend import XendAPIConstants
from xen.util import acmpolicy, security, xsconstants
from xen.util.acmpolicy import ACMPolicy
from xen.xend.XendDomain import DOM0_UUID
+from XmTestLib.acm import *
import commands
import os
import base64
+if not isACMEnabled():
+ SKIP("Not running this test since ACM not enabled.")
+
+try:
+ session = xapi.connect()
+except:
+ SKIP("Skipping this test since xm is not using the Xen-API.")
+
xm_test = {}
xm_test['policyname'] = "xm-test"
xm_test['date'] = "Fri Sep 29 14:44:38 2006"
diff --git a/tools/xm-test/tests/security-acm/09_security-acm_pol_update.py b/tools/xm-test/tests/security-acm/09_security-acm_pol_update.py
index f1a6757faf..fc3dab7664 100644
--- a/tools/xm-test/tests/security-acm/09_security-acm_pol_update.py
+++ b/tools/xm-test/tests/security-acm/09_security-acm_pol_update.py
@@ -7,6 +7,7 @@
from XmTestLib import xapi
from XmTestLib.XenAPIDomain import XmTestAPIDomain
+from XmTestLib.acm import *
from XmTestLib import *
from xen.xend import XendAPIConstants
from xen.util import security, xsconstants
@@ -16,6 +17,14 @@ import base64
import struct
import time
+if not isACMEnabled():
+ SKIP("Not running this test since ACM not enabled.")
+
+try:
+ session = xapi.connect()
+except:
+ SKIP("Skipping this test since xm is not using the Xen-API.")
+
def typestoxml(types):
res = ""
for t in types: