Fix: Use get device id utility function to get device id when switch is running outside the test container(for eg:)
Change-Id: I436896fc9419ea0ad6985efcea1cba78a96e7da8
diff --git a/src/test/acl/aclTest.py b/src/test/acl/aclTest.py
index 8bc5f24..79de329 100644
--- a/src/test/acl/aclTest.py
+++ b/src/test/acl/aclTest.py
@@ -34,7 +34,6 @@
class acl_exchange(unittest.TestCase):
app = ('org.onosproject.acl')
- device_id = 'of:' + get_mac('ovsbr0')
test_path = os.path.dirname(os.path.realpath(__file__))
onos_config_path = os.path.join(test_path, '..', 'setup/onos-config')
GATEWAY = '192.168.10.50'
@@ -66,7 +65,6 @@
def tearDownClass(cls):
'''Deactivate the acl app'''
-
def setUp(self):
''' Activate the acl app'''
self.maxDiff = None ##for assert_equal compare outputs on failure
diff --git a/src/test/utils/ACL.py b/src/test/utils/ACL.py
index 3a99a39..74a9e52 100644
--- a/src/test/utils/ACL.py
+++ b/src/test/utils/ACL.py
@@ -31,7 +31,7 @@
remove_acl_rule_url = 'http://%s:8181/onos/v1/acl/rules/%s' %(controller, id)
clear_all_acl_rule_url = 'http://%s:8181/onos/v1/acl/rules' %(controller)
iface_create_onos_url = 'http://%s:8181/onos/v1/network/configuration' %(controller)
- device_id = 'of:' + get_mac('ovsbr0')
+ device_id = 'of:' + get_mac()
MAX_PORTS = 100
def __init__(self, ipv4Prefix ='v4', srcIp ='null', dstIp ='null', ipProto = 'null', dstTpPort = 0, action = 'null', ingress_iface = 1, egress_iface = 2,iface_num = 0, iface_name = 'null', iface_count = 0, iface_ip = 'null'):
@@ -47,6 +47,7 @@
self.iface_num = iface_num
self.iface_name = iface_name
self.iface_ip = iface_ip
+ self.device_id = OnosCtrl.get_device_id()
def adding_acl_rule(self, ipv4Prefix, srcIp, dstIp, ipProto ='null', dstTpPort='null', action= 'include'):
'''This function is generating ACL json file and post to ONOS for creating a ACL rule'''