From 6102cace934c5ef156e7e1e21966cf3950dc40e5 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 25 Mar 2011 21:47:57 +0000 Subject: Remove unmaintained Access Control Module (ACM) from hypervisor. Signed-off-by: Keir Fraser --- tools/xm-test/lib/XmTestLib/XenAPIDomain.py | 4 -- tools/xm-test/lib/XmTestLib/XenDomain.py | 5 -- tools/xm-test/lib/XmTestLib/acm.py | 101 ---------------------------- tools/xm-test/lib/XmTestLib/block_utils.py | 2 - 4 files changed, 112 deletions(-) delete mode 100644 tools/xm-test/lib/XmTestLib/acm.py (limited to 'tools/xm-test/lib') diff --git a/tools/xm-test/lib/XmTestLib/XenAPIDomain.py b/tools/xm-test/lib/XmTestLib/XenAPIDomain.py index 3c5310f061..1ca2307c27 100644 --- a/tools/xm-test/lib/XmTestLib/XenAPIDomain.py +++ b/tools/xm-test/lib/XmTestLib/XenAPIDomain.py @@ -23,7 +23,6 @@ import os import sys from XmTestLib import * from types import DictType -from acm import * class XenAPIConfig: @@ -40,9 +39,6 @@ class XenAPIConfig: 'ramdisk': 'PV_ramdisk', 'root' : 'PV_args', 'extra' : 'PV_args' } - if isACMEnabled(): - #A default so every VM can start with ACM enabled - self.opts["security_label"] = "ACM:xm-test:red" def setOpt(self, name, value): """Set an option in the config""" diff --git a/tools/xm-test/lib/XmTestLib/XenDomain.py b/tools/xm-test/lib/XmTestLib/XenDomain.py index f15b6a00a7..ae8c550c48 100644 --- a/tools/xm-test/lib/XmTestLib/XenDomain.py +++ b/tools/xm-test/lib/XmTestLib/XenDomain.py @@ -30,7 +30,6 @@ from config import * from Console import * from XenDevice import * from DomainTracking import * -from acm import * DOM0_UUID = "00000000-0000-0000-0000-000000000000" @@ -61,9 +60,6 @@ class XenConfig: self.defaultOpts["disk"] = [] self.defaultOpts["vif"] = [] self.defaultOpts["vtpm"] = [] - if isACMEnabled(): - #A default so every VM can start with ACM enabled - self.defaultOpts["access_control"] = ['policy=xm-test,label=red'] self.opts = self.defaultOpts @@ -91,7 +87,6 @@ class XenConfig: output = file(filename, "w") output.write(self.toString()) output.close() - ACMPrepareSystem(self.opts) def __str__(self): """When used as a string, we represent ourself by a config diff --git a/tools/xm-test/lib/XmTestLib/acm.py b/tools/xm-test/lib/XmTestLib/acm.py deleted file mode 100644 index f8a62f4991..0000000000 --- a/tools/xm-test/lib/XmTestLib/acm.py +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/python -""" - Copyright (C) International Business Machines Corp., 2006 - Author: Stefan Berger - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; under version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -""" -from Test import * -import xen.util.xsm.xsm as security -from xen.xm.main import server -from xen.util import xsconstants -import re - -try: - from acm_config import * -except: - ACM_LABEL_RESOURCES = False - -labeled_resources = {} -acm_verbose = False -policy='xm-test' - - -def isACMEnabled(): - return security.on() - -def setCurrentPolicy(plcy): - global policy - policy = plcy - -def ACMSetPolicy(): - cmd='xm dumppolicy | grep -E "^POLICY REFERENCE = ' + policy + '.$"' - s, o = traceCommand(cmd) - if o != "": - return - s, o = traceCommand("xm setpolicy ACM %s" % (policy)) - if s != 0: - FAIL("Could not load the required policy '%s'.\n" - "Start the system without any policy.\n%s" % \ - (policy, o)) - -def ACMPrepareSystem(resources): - if isACMEnabled(): - ACMSetPolicy() - ACMLabelResources(resources) - -def ACMLabelResources(resources): - for k, v in resources.items(): - if k == "disk": - for vv in v: - res = vv.split(',')[0] - ACMLabelResource(res) - -# Applications may label resources explicitly by calling this function -def ACMLabelResource(resource, label='red'): - if not isACMEnabled(): - return - if acm_verbose: - print "labeling resource %s with label %s" % (resource, label) - if not ACM_LABEL_RESOURCES: - SKIP("Skipping test since not allowed to label resources in " - "test suite") - if not isACMResourceLabeled(resource): - ACMUnlabelResource(resource) - s, o = traceCommand("xm addlabel %s res %s" % (label, resource)) - if s != 0: - FAIL("Could not add label to resource") - else: - labeled_resources["%s" % resource] = 1 - - -# Application may remove a label from a resource. It has to call this -# function and must do so once a resource for re-labeling a resource -def ACMUnlabelResource(resource): - s, o = traceCommand("xm rmlabel res %s" % (resource)) - labeled_resources["%s" % resource] = 0 - - -def isACMResourceLabeled(resource): - """ Check whether a resource has been labeled using this API - and while running the application """ - try: - if labeled_resources["%s" % resource] == 1: - if acm_verbose: - print "resource %s already labeled!" % resource - return True - except: - return False - return False diff --git a/tools/xm-test/lib/XmTestLib/block_utils.py b/tools/xm-test/lib/XmTestLib/block_utils.py index 58124c832a..c302efeb15 100644 --- a/tools/xm-test/lib/XmTestLib/block_utils.py +++ b/tools/xm-test/lib/XmTestLib/block_utils.py @@ -6,7 +6,6 @@ import time from XmTestLib import * -from acm import * import xen.util.blkif @@ -27,7 +26,6 @@ def get_state(domain, devname): def block_attach(domain, phy, virt): - ACMLabelResource(phy) status, output = traceCommand("xm block-attach %s %s %s w" % (domain.getName(), phy, virt)) if status != 0: -- cgit v1.2.3