From 2ef757a05efdaccdd31dad65f6bf6134fe5af2af Mon Sep 17 00:00:00 2001 From: Ryan Moats Date: Thu, 3 Sep 2015 12:47:24 -0500 Subject: [PATCH] Add IT case for Bug 4027 This is aimed at helping triage that bug and avoiding regression in the future Change-Id: Icb4fabdea56f72ff23ccc4943fb784fe0e0acba0 Signed-off-by: Ryan Moats --- .../neutron/e2etest/ITNeutronE2E.java | 1 + .../e2etest/Neutron_Bug4027_Tests.java | 70 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 integration/test/src/test/java/org/opendaylight/neutron/e2etest/Neutron_Bug4027_Tests.java diff --git a/integration/test/src/test/java/org/opendaylight/neutron/e2etest/ITNeutronE2E.java b/integration/test/src/test/java/org/opendaylight/neutron/e2etest/ITNeutronE2E.java index 3900ee603..ebff4847e 100644 --- a/integration/test/src/test/java/org/opendaylight/neutron/e2etest/ITNeutronE2E.java +++ b/integration/test/src/test/java/org/opendaylight/neutron/e2etest/ITNeutronE2E.java @@ -107,6 +107,7 @@ public class ITNeutronE2E { // tests related to bugs Neutron_Bug3812_Tests.runTests(base); Tempest_PortsIpV6TestJSON.runTests(base); + Neutron_Bug4027_Tests.runTests(base); } static HttpURLConnection HttpURLConnectionFactoryGet(URL url) throws Exception { diff --git a/integration/test/src/test/java/org/opendaylight/neutron/e2etest/Neutron_Bug4027_Tests.java b/integration/test/src/test/java/org/opendaylight/neutron/e2etest/Neutron_Bug4027_Tests.java new file mode 100644 index 000000000..273b46575 --- /dev/null +++ b/integration/test/src/test/java/org/opendaylight/neutron/e2etest/Neutron_Bug4027_Tests.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2015 IBM, Inc. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +package org.opendaylight.neutron.e2etest; + +import java.io.OutputStreamWriter; + +import java.lang.Thread; + +import java.net.HttpURLConnection; +import java.net.URL; + +import org.junit.Assert; + +public class Neutron_Bug4027_Tests { + String base; + + public Neutron_Bug4027_Tests(String base) { + this.base = base; + } + + public void check_bug4027() { + // create network + String url_n = base + "/ports"; + String content_n = "{ \"port\" : {" + + "\"id\" : \"ea2ac142-8454-4990-8bfb-7a218479864b\"," + + "\"network_id\" : \"e44cdc39-2d43-4775-82e8-b18da318da61\"," + + "\"name\" : \"\"," + + "\"admin_state_up\" : true," + + "\"mac_address\" : \"FA:16:3E:A2:44:3F\"," + + "\"fixed_ips\" : [ {" + + "\"ip_address\" : \"10.1.0.2\"," + + "\"subnet_id\" : \"6aba69a3-a541-4b93-b724-7bf822e4986b\" } ]," + + "\"device_id\" : \"dhcp58155ae3-f2e7-51ca-9978-71c513ab02ee-e44cdc39-2d43-4775-82e8-b18da318da61\"," + + "\"device_owner\" : \"network:dhcp\"," + + "\"tenant_id\" : \"52e413cd075d47e4808f1845c7d8a2c8\"," + + "\"security_groups\" : [ ]," + + "\"allowed_address_pairs\" : [ ]," + + "\"binding:host_id\" : \"devstack-control\"," + + "\"binding:vnic_type\" : \"normal\"," + + "\"binding:vif_type\" : \"unbound\"," + + "\"binding:vif_details\" : [ { } ] } }"; + ITNeutronE2E.test_create(url_n, content_n, "Bug 4027 Port Post Failed"); + String url_2 = base + "/ports/ea2ac142-8454-4990-8bfb-7a218479864b"; + String content_2 = " { \"port\" : {" + + "\"id\" : \"ea2ac142-8454-4990-8bfb-7a218479864b\"," + + "\"name\" : \"\"," + + "\"admin_state_up\" : true," + + "\"device_id\" : \"dhcp58155ae3-f2e7-51ca-9978-71c513ab02ee-e44cdc39-2d43-4775-82e8-b18da318da61\"," + + "\"device_owner\" : \"network:dhcp\"," + + "\"security_groups\" : [ ]," + + "\"allowed_address_pairs\" : [ ]," + + "\"binding:host_id\" : \"devstack-control\"," + + "\"binding:vnic_type\" : \"normal\"," + + "\"binding:vif_type\" : \"ovs\"," + + "\"binding:vif_details\" : [ { \"port_filter\" : true } ]," + + "\"extra_dhcp_opts\" : [ ] } } }"; + ITNeutronE2E.test_modify(url_2, content_2, "Bug 4027 Port Modify Failed"); + } + + public static void runTests(String base) { + Neutron_Bug4027_Tests bugTest = new Neutron_Bug4027_Tests(base); + bugTest.check_bug4027(); + } +} -- 2.36.6