checkstyle: TypeName
[neutron.git] / integration / test / src / test / java / org / opendaylight / neutron / e2etest / NeutronBug4027Tests.java
1 /*
2  * Copyright (C) 2015 IBM, Inc.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.neutron.e2etest;
10
11 public class NeutronBug4027Tests {
12     String base;
13
14     public NeutronBug4027Tests(String base) {
15         this.base = base;
16     }
17
18     public void check_bug4027() {
19         // create network
20         String urlN = base + "/ports";
21         String contentN = "{ \"port\" : {" + "\"id\" : \"ea2ac142-8454-4990-8bfb-7a218479864b\","
22                 + "\"network_id\" : \"e44cdc39-2d43-4775-82e8-b18da318da61\"," + "\"name\" : \"\","
23                 + "\"admin_state_up\" : true," + "\"mac_address\" : \"FA:16:3E:A2:44:3F\"," + "\"fixed_ips\" : [ {"
24                 + "\"ip_address\" : \"10.1.0.2\"," + "\"subnet_id\" : \"6aba69a3-a541-4b93-b724-7bf822e4986b\" } ],"
25                 + "\"device_id\" : \"dhcp58155ae3-f2e7-51ca-9978-71c513ab02ee-e44cdc39-2d43-4775-82e8-b18da318da61\","
26                 + "\"device_owner\" : \"network:dhcp\"," + "\"tenant_id\" : \"52e413cd075d47e4808f1845c7d8a2c8\","
27                 + "\"security_groups\" : [ ]," + "\"allowed_address_pairs\" : [ ],"
28                 + "\"binding:host_id\" : \"devstack-control\"," + "\"binding:vnic_type\" : \"normal\","
29                 + "\"binding:vif_type\" : \"unbound\"," + "\"binding:vif_details\" : { } } }";
30         ITNeutronE2E.test_create(urlN, contentN, "Bug 4027 Port Post Failed");
31         String url2 = base + "/ports/ea2ac142-8454-4990-8bfb-7a218479864b";
32         String content2 = " { \"port\" : {" + "\"id\" : \"ea2ac142-8454-4990-8bfb-7a218479864b\"," + "\"name\" : \"\","
33                 + "\"admin_state_up\" : true,"
34                 + "\"device_id\" : \"dhcp58155ae3-f2e7-51ca-9978-71c513ab02ee-e44cdc39-2d43-4775-82e8-b18da318da61\","
35                 + "\"device_owner\" : \"network:dhcp\"," + "\"security_groups\" : [ ],"
36                 + "\"allowed_address_pairs\" : [ ]," + "\"binding:host_id\" : \"devstack-control\","
37                 + "\"binding:vnic_type\" : \"normal\"," + "\"binding:vif_type\" : \"ovs\","
38                 + "\"binding:vif_details\" : { \"port_filter\" : \"true\" }," + "\"extra_dhcp_opts\" : [ ] } } }";
39         ITNeutronE2E.test_modify(url2, content2, "Bug 4027 Port Modify Failed");
40     }
41
42     public static void runTests(String base) {
43         NeutronBug4027Tests bugTest = new NeutronBug4027Tests(base);
44         bugTest.check_bug4027();
45     }
46 }