Updated profile processing
Profiles _must_ be placed in the profiles directory now. They
should be referred to as --profile=foo where the file profiles/foo.py
exists.
Added profiles/noing.py for the "no IN_PORT output action supported".
Added .gitignore.
diff --git a/tests/.gitignore b/tests/.gitignore
new file mode 100644
index 0000000..48da841
--- /dev/null
+++ b/tests/.gitignore
@@ -0,0 +1,3 @@
+*.pyc
+profiles/*.pyc
+*~
diff --git a/tests/oft b/tests/oft
index a0f8c61..828eefa 100755
--- a/tests/oft
+++ b/tests/oft
@@ -265,15 +265,23 @@
return (config, args)
def check_profile(config):
+ """
+ Import a profile from the profiles library
+ """
+
global profile_mod
if "profile" in config and config["profile"]:
- logging.info("Importing profile: %s.py" % config["profile"])
+ logging.info("Importing profile: %s" % config["profile"])
+ profile_name = "profiles." + config["profile"]
try:
- profile_mod = __import__(config["profile"])
+ top_mod = __import__(profile_name)
+ profile_mod = eval("top_mod." + config["profile"])
+ logging.info("Imported profile %s. Dir: %s" %
+ (config["profile"], str(dir(profile_mod))))
except:
logging.info("Could not import profile: %s.py" %
config["profile"])
- print "Failed to import profile: %s.py" % config["profile"]
+ print "Failed to import profile: %s" % config["profile"]
profile_mod = None
else:
logging.info("No profile specified")
diff --git a/tests/profiles/__init__.py b/tests/profiles/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/profiles/__init__.py
diff --git a/tests/profile.py b/tests/profiles/example.py
similarity index 100%
rename from tests/profile.py
rename to tests/profiles/example.py
diff --git a/tests/profiles/noing.py b/tests/profiles/noing.py
new file mode 100644
index 0000000..c9abc63
--- /dev/null
+++ b/tests/profiles/noing.py
@@ -0,0 +1,19 @@
+"""
+No-ingress action profile
+
+Profile for switch that does not support the IN_PORT port
+in the output action.
+
+We also don't run the port config modify test for this profile.
+"""
+
+#@var skip_test_list The list of tests to skip for this run
+skip_test_list = [
+ "PortConfigMod",
+ "FloodMinusPort",
+ "ModifyL2DstIngressMC",
+ "ModifyL2DstIngress",
+ "DirectMC",
+ "AllPlusIngress",
+ "FloodPlusIngress"
+]