Add IT cases for Security Rules 30/25430/1
authorRyan Moats <rmoats@us.ibm.com>
Tue, 18 Aug 2015 14:30:18 +0000 (09:30 -0500)
committerRyan Moats <rmoats@us.ibm.com>
Tue, 18 Aug 2015 14:30:18 +0000 (09:30 -0500)
Add missing CRUD operations to IT for Security Rules

Change-Id: I564e9cc1c4dc86c5cfaa3ce9c8addb69278f1803
Signed-off-by: Ryan Moats <rmoats@us.ibm.com>
integration/test/src/test/java/org/opendaylight/neutron/e2etest/NeutronSecurityRuleTests.java

index d3851cd4c262cb7ccc46133d2fb32e4c15595890..b04e4b41b7cf08d2774aaa74f38a969ed9f03830 100644 (file)
@@ -29,8 +29,41 @@ public class NeutronSecurityRuleTests {
         ITNeutronE2E.test_fetch(url, "Security Rule Collection GET failed");
     }
 
+    public void singleton_sr_create_test() {
+        String url = base + "/security-group-rules";
+        String content = " {\"security_group_rule\": " +
+            "{\"remote_group_id\": null, \"direction\": \"ingress\", " +
+            "\"remote_ip_prefix\": null, \"protocol\": \"tcp\", " +
+            "\"ethertype\": \"IPv6\", \"tenant_id\": " +
+            "\"00f340c7c3b34ab7be1fc690c05a0275\", \"port_range_max\": 77, " +
+            "\"port_range_min\": 77, " +
+            "\"id\": \"9b4be7fa-e56e-40fb-9516-1f0fa9185669\", " +
+            "\"security_group_id\": " +
+            "\"b60490fe-60a5-40be-af63-1d641381b784\"}}";
+        ITNeutronE2E.test_create(url, content, "Security Rule Singleton Post Failed");
+    }
+
+    public void sr_element_get_test() {
+        String url = base + "/security-group-rules/9b4be7fa-e56e-40fb-9516-1f0fa9185669";
+        ITNeutronE2E.test_fetch(url, true, "Security Rule Element Get Failed");
+    }
+
+    public void sr_delete_test() {
+        String url = base + "/security-group-rules/9b4be7fa-e56e-40fb-9516-1f0fa9185669";
+        ITNeutronE2E.test_delete(url, "Security Rule Delete Failed");
+    }
+
+    public void sr_element_negative_get_test() {
+        String url = base + "/security-group-rules/9b4be7fa-e56e-40fb-9516-1f0fa9185669";
+        ITNeutronE2E.test_fetch(url, false, "Security Rule Element Negative Get Failed");
+    }
+
     public static void runTests(String base) {
         NeutronSecurityRuleTests securityRule_tester = new NeutronSecurityRuleTests(base);
         securityRule_tester.securityRule_collection_get_test();
+        securityRule_tester.singleton_sr_create_test();
+        securityRule_tester.sr_element_get_test();
+        securityRule_tester.sr_delete_test();
+        securityRule_tester.sr_element_negative_get_test();
     }
 }