2 * Copyright © 2015, 2017 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
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
8 package org.opendaylight.ovsdb.hwvtepsouthbound.it;
10 import static org.junit.Assert.assertTrue;
11 import static org.junit.Assert.fail;
12 import static org.ops4j.pax.exam.CoreOptions.composite;
13 import static org.ops4j.pax.exam.CoreOptions.maven;
14 import static org.ops4j.pax.exam.CoreOptions.vmOption;
15 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
16 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
18 import java.lang.annotation.Annotation;
19 import java.lang.reflect.Method;
20 import java.net.InetAddress;
21 import java.net.UnknownHostException;
22 import java.util.Collection;
23 import java.util.HashSet;
24 import java.util.List;
25 import java.util.Properties;
28 import javax.annotation.Nullable;
29 import javax.inject.Inject;
31 import org.junit.After;
32 import org.junit.Assert;
33 import org.junit.Before;
34 import org.junit.Ignore;
35 import org.junit.Test;
36 import org.junit.runner.RunWith;
37 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
38 import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
39 import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
40 import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
41 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
42 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
43 import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
44 import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepSouthboundConstants;
45 import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepSouthboundMapper;
46 import org.opendaylight.ovsdb.utils.hwvtepsouthbound.utils.HwvtepSouthboundUtils;
47 import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
48 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
49 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
50 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalRef;
51 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName;
52 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.PhysicalSwitchAugmentation;
53 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.PhysicalSwitchAugmentationBuilder;
54 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.ConnectionInfo;
55 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.ConnectionInfoBuilder;
56 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.ManagementIps;
57 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelIps;
58 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.Tunnels;
59 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
60 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
61 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
62 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
63 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
64 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
65 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
66 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
67 import org.ops4j.pax.exam.Configuration;
68 import org.ops4j.pax.exam.Option;
69 import org.ops4j.pax.exam.junit.PaxExam;
70 import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
71 import org.ops4j.pax.exam.options.MavenUrlReference;
72 import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
73 import org.ops4j.pax.exam.spi.reactors.PerClass;
74 import org.ops4j.pax.exam.util.Filter;
75 import org.osgi.framework.BundleContext;
76 import org.slf4j.Logger;
77 import org.slf4j.LoggerFactory;
79 @RunWith(PaxExam.class)
80 @ExamReactorStrategy(PerClass.class)
81 public class HwvtepSouthboundIT extends AbstractMdsalTestBase {
82 private static final Logger LOG = LoggerFactory.getLogger(HwvtepSouthboundIT.class);
86 public static final String ORG_OPS4J_PAX_LOGGING_CFG = "etc/org.ops4j.pax.logging.cfg";
87 public static final String CUSTOM_PROPERTIES = "etc/custom.properties";
88 public static final String SERVER_IPADDRESS = "ovsdbserver.ipaddress";
89 public static final String DEFAULT_SERVER_IPADDRESS = "127.0.0.1";
90 public static final String SERVER_PORT = "ovsdbserver.port";
91 public static final String DEFAULT_SERVER_PORT = "6640";
92 public static final String CONNECTION_TYPE = "ovsdbserver.connection";
93 public static final String CONNECTION_TYPE_ACTIVE = "active";
94 public static final String CONNECTION_TYPE_PASSIVE = "passive";
95 public static final int CONNECTION_INIT_TIMEOUT = 10000;
96 public static final String OPENFLOW_CONNECTION_PROTOCOL = "tcp";
97 private static final String PS_NAME = "ps0";
99 private static final int OVSDB_UPDATE_TIMEOUT = 1000;
100 private static final int OVSDB_ROUNDTRIP_TIMEOUT = 10000;
102 private static MdsalUtils mdsalUtils = null;
103 private static boolean setup = false;
104 private static int testMethodsRemaining;
105 private static String addressStr;
106 private static int portNumber;
107 private static String connectionType;
108 private static Node hwvtepNode;
109 @Inject @Filter(timeout=60000)
110 private static DataBroker dataBroker = null;
112 private BundleContext bundleContext;
114 private static final NotifyingDataChangeListener OPERATIONAL_LISTENER =
115 new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL);
117 private static class NotifyingDataChangeListener implements DataTreeChangeListener<Node> {
118 private final LogicalDatastoreType type;
119 private final Set<InstanceIdentifier<Node>> createdNodes = new HashSet<>();
120 private final Set<InstanceIdentifier<Node>> removedNodes = new HashSet<>();
121 private final Set<InstanceIdentifier<Node>> updatedNodes = new HashSet<>();
123 private NotifyingDataChangeListener(LogicalDatastoreType type) {
128 public void onDataTreeChanged(Collection<DataTreeModification<Node>> changes) {
129 for (DataTreeModification<Node> change : changes) {
130 final InstanceIdentifier<Node> key = change.getRootPath().getRootIdentifier();
131 final DataObjectModification<Node> mod = change.getRootNode();
132 switch (mod.getModificationType()) {
134 removedNodes.add(key);
136 case SUBTREE_MODIFIED:
137 updatedNodes.add(key);
140 if (mod.getDataBefore() == null) {
141 LOG.trace("Data added: {}", mod.getDataAfter());
142 createdNodes.add(key);
144 updatedNodes.add(key);
148 throw new IllegalArgumentException("Unhandled modification type " + mod.getModificationType());
153 public boolean isCreated(InstanceIdentifier<Node> iid) {
154 return createdNodes.remove(iid);
157 public boolean isRemoved(InstanceIdentifier<Node> iid) {
158 return removedNodes.remove(iid);
161 public boolean isUpdated(InstanceIdentifier<Node> iid) {
162 return updatedNodes.remove(iid);
167 public Option[] config() {
168 Option[] options = super.config();
169 Option[] propertyOptions = getPropertiesOptions();
170 Option[] otherOptions = getOtherOptions();
171 Option[] combinedOptions = new Option[options.length + propertyOptions.length + otherOptions.length];
172 System.arraycopy(options, 0, combinedOptions, 0, options.length);
173 System.arraycopy(propertyOptions, 0, combinedOptions, options.length, propertyOptions.length);
174 System.arraycopy(otherOptions, 0, combinedOptions, options.length + propertyOptions.length,
175 otherOptions.length);
176 return combinedOptions;
179 private Option[] getOtherOptions() {
180 return new Option[] {
181 vmOption("-javaagent:../jars/org.jacoco.agent.jar=destfile=../../jacoco-it.exec"),
187 public String getKarafDistro() {
189 .groupId("org.opendaylight.ovsdb")
190 .artifactId("hwvtepsouthbound-karaf")
191 .versionAsInProject()
197 public MavenUrlReference getFeatureRepo() {
199 .groupId("org.opendaylight.ovsdb")
200 .artifactId("hwvtepsouthbound-features")
201 .classifier("features")
203 .versionAsInProject();
207 public String getFeatureName() {
208 return "odl-ovsdb-hwvtepsouthbound-test";
211 protected String usage() {
212 return "Integration Test needs a valid connection configuration as follows :\n"
213 + "active connection : mvn -Dovsdbserver.ipaddress=x.x.x.x -Dovsdbserver.port=yyyy verify\n"
214 + "passive connection : mvn -Dovsdbserver.connection=passive verify\n";
218 public Option getLoggingOption() {
219 Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
220 logConfiguration(HwvtepSouthboundIT.class),
221 LogLevel.INFO.name());
222 option = composite(option, super.getLoggingOption());
226 private Option[] getPropertiesOptions() {
227 Properties props = new Properties(System.getProperties());
228 String addressStr = props.getProperty(SERVER_IPADDRESS, DEFAULT_SERVER_IPADDRESS);
229 String portStr = props.getProperty(SERVER_PORT, DEFAULT_SERVER_PORT);
230 String connectionType = props.getProperty(CONNECTION_TYPE, CONNECTION_TYPE_ACTIVE);
232 LOG.info("getPropertiesOptions: Using the following properties: mode= {}, ip:port= {}:{}",
233 connectionType, addressStr, portStr);
235 return new Option[] {
236 editConfigurationFilePut(CUSTOM_PROPERTIES, SERVER_IPADDRESS, addressStr),
237 editConfigurationFilePut(CUSTOM_PROPERTIES, SERVER_PORT, portStr),
238 editConfigurationFilePut(CUSTOM_PROPERTIES, CONNECTION_TYPE, connectionType),
244 public void setup() throws InterruptedException {
246 LOG.info("Skipping setup, already initialized");
252 } catch (Exception e) {
253 LOG.warn("Failed to setup test", e);
254 fail("Failed to setup test: " + e);
257 addressStr = bundleContext.getProperty(SERVER_IPADDRESS);
258 String portStr = bundleContext.getProperty(SERVER_PORT);
260 portNumber = Integer.parseInt(portStr);
261 } catch (NumberFormatException e) {
262 fail("Invalid port number " + portStr + System.lineSeparator() + usage() + e);
265 connectionType = bundleContext.getProperty(CONNECTION_TYPE);
267 LOG.info("setUp: Using the following properties: mode= {}, ip:port= {}:{}",
268 connectionType, addressStr, portNumber);
269 if (connectionType.equalsIgnoreCase(CONNECTION_TYPE_ACTIVE)) {
270 if (addressStr == null) {
275 mdsalUtils = new MdsalUtils(dataBroker);
276 assertTrue("Did not find " + HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue(), getHwvtepTopology());
277 final ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portNumber);
278 final InstanceIdentifier<Node> iid = HwvtepSouthboundUtils.createInstanceIdentifier(connectionInfo);
279 final DataTreeIdentifier<Node> treeId =
280 new DataTreeIdentifier<Node>(LogicalDatastoreType.OPERATIONAL, iid);
282 dataBroker.registerDataTreeChangeListener(treeId, OPERATIONAL_LISTENER);
284 hwvtepNode = connectHwvtepNode(connectionInfo);
285 // Let's count the test methods (we need to use this instead of @AfterClass on teardown() since the latter is
286 // useless with pax-exam)
287 for (Method method : getClass().getMethods()) {
288 boolean testMethod = false;
289 boolean ignoreMethod = false;
290 for (Annotation annotation : method.getAnnotations()) {
291 if (Test.class.equals(annotation.annotationType())) {
294 if (Ignore.class.equals(annotation.annotationType())) {
298 if (testMethod && !ignoreMethod) {
299 testMethodsRemaining++;
302 LOG.info("{} test methods to run", testMethodsRemaining);
307 private Boolean getHwvtepTopology() {
308 LOG.info("getHwvtepTopology: looking for {}...", HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue());
309 Boolean found = false;
310 final TopologyId topologyId = HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID;
311 InstanceIdentifier<Topology> path =
312 InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(topologyId));
313 for (int i = 0; i < 60; i++) {
314 Topology topology = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, path);
315 if (topology != null) {
316 LOG.info("getHwvtepTopology: found {}...", HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue());
320 LOG.info("getHwvtepTopology: still looking ({})...", i);
323 } catch (InterruptedException e) {
324 LOG.warn("Interrupted while waiting for {}",
325 HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue(), e);
332 private Node connectHwvtepNode(ConnectionInfo connectionInfo) throws InterruptedException {
333 final InstanceIdentifier<Node> iid = HwvtepSouthboundUtils.createInstanceIdentifier(connectionInfo);
334 Assert.assertTrue(mdsalUtils.put(LogicalDatastoreType.CONFIGURATION,
335 iid, HwvtepSouthboundUtils.createNode(connectionInfo)));
336 waitForOperationalCreation(iid);
337 Node node = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, iid);
338 Assert.assertNotNull(node);
339 LOG.info("Connected to {}", HwvtepSouthboundUtils.connectionInfoToString(connectionInfo));
343 private static void disconnectHwvtepNode(final ConnectionInfo connectionInfo) throws InterruptedException {
344 final InstanceIdentifier<Node> iid = HwvtepSouthboundUtils.createInstanceIdentifier(connectionInfo);
345 Assert.assertTrue(mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, iid));
346 waitForOperationalDeletion(iid);
347 Node node = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, iid);
348 Assert.assertNull(node);
349 LOG.info("Disconnected from {}", HwvtepSouthboundUtils.connectionInfoToString(connectionInfo));
352 private void waitForOperationalCreation(InstanceIdentifier<Node> iid) throws InterruptedException {
353 synchronized (OPERATIONAL_LISTENER) {
354 long _start = System.currentTimeMillis();
355 LOG.info("Waiting for OPERATIONAL DataChanged creation on {}", iid);
356 while (!OPERATIONAL_LISTENER.isCreated(
357 iid) && (System.currentTimeMillis() - _start) < OVSDB_ROUNDTRIP_TIMEOUT) {
358 OPERATIONAL_LISTENER.wait(OVSDB_UPDATE_TIMEOUT);
360 LOG.info("Woke up, waited {} for creation of {}", (System.currentTimeMillis() - _start), iid);
364 private static void waitForOperationalDeletion(InstanceIdentifier<Node> iid) throws InterruptedException {
365 synchronized (OPERATIONAL_LISTENER) {
366 long _start = System.currentTimeMillis();
367 LOG.info("Waiting for OPERATIONAL DataChanged deletion on {}", iid);
368 while (!OPERATIONAL_LISTENER.isRemoved(
369 iid) && (System.currentTimeMillis() - _start) < OVSDB_ROUNDTRIP_TIMEOUT) {
370 OPERATIONAL_LISTENER.wait(OVSDB_UPDATE_TIMEOUT);
372 LOG.info("Woke up, waited {} for deletion of {}", (System.currentTimeMillis() - _start), iid);
376 private ConnectionInfo getConnectionInfo(String addressStr, int portNumber) {
377 InetAddress inetAddress = null;
379 inetAddress = InetAddress.getByName(addressStr);
380 } catch (UnknownHostException e) {
381 fail("Could not resolve " + addressStr + ": " + e);
384 IpAddress address = HwvtepSouthboundMapper.createIpAddress(inetAddress);
385 PortNumber port = new PortNumber(portNumber);
387 final ConnectionInfo connectionInfo = new ConnectionInfoBuilder()
388 .setRemoteIp(address)
391 LOG.info("connectionInfo: {}", connectionInfo);
392 return connectionInfo;
395 private static class TestPhysicalSwitch implements AutoCloseable {
396 private final ConnectionInfo connectionInfo;
397 private final String psName;
400 public TestPhysicalSwitch(final ConnectionInfo connectionInfo, String psName) {
401 this(connectionInfo, psName, null, null, null, true, null, null, null);
404 public TestPhysicalSwitch (final ConnectionInfo connectionInfo, final String name,
405 @Nullable InstanceIdentifier<Node> psIid, @Nullable NodeId psNodeId,
406 @Nullable final String description, final boolean setManagedBy,
407 @Nullable final List<ManagementIps> managementIps,
408 @Nullable final List<TunnelIps> tunnelIps,
409 @Nullable final List<Tunnels> tunnels) {
410 this.connectionInfo = connectionInfo;
412 NodeBuilder psNodeBuilder = new NodeBuilder();
414 psIid = HwvtepSouthboundUtils.createInstanceIdentifier(connectionInfo, new HwvtepNodeName(psName));
416 if(psNodeId == null) {
417 psNodeId = HwvtepSouthboundMapper.createManagedNodeId(psIid);
419 psNodeBuilder.setNodeId(psNodeId);
420 PhysicalSwitchAugmentationBuilder psAugBuilder = new PhysicalSwitchAugmentationBuilder();
421 psAugBuilder.setHwvtepNodeName(new HwvtepNodeName(psName));
422 if(description != null) {
423 psAugBuilder.setHwvtepNodeDescription(description);
426 InstanceIdentifier<Node> nodePath = HwvtepSouthboundUtils.createInstanceIdentifier(connectionInfo);
427 psAugBuilder.setManagedBy(new HwvtepGlobalRef(nodePath));
429 psAugBuilder.setManagementIps(managementIps);
430 psAugBuilder.setTunnelIps(tunnelIps);
431 psAugBuilder.setTunnels(tunnels);
432 psNodeBuilder.addAugmentation(PhysicalSwitchAugmentation.class, psAugBuilder.build());
433 LOG.debug("Built with intent to store PhysicalSwitch data {}", psAugBuilder.toString());
435 mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, psIid, psNodeBuilder.build()));
437 Thread.sleep(OVSDB_UPDATE_TIMEOUT);
438 } catch (InterruptedException e) {
439 LOG.warn("Sleep interrupted while waiting for bridge creation (bridge {})", psName, e);
444 public void close() {
445 final InstanceIdentifier<Node> iid =
446 HwvtepSouthboundUtils.createInstanceIdentifier(connectionInfo, new HwvtepNodeName(psName));
447 Assert.assertTrue(mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, iid));
449 Thread.sleep(OVSDB_UPDATE_TIMEOUT);
450 } catch (InterruptedException e) {
451 LOG.warn("Sleep interrupted while waiting for bridge deletion (bridge {})", psName, e);
457 public void teardown() {
458 testMethodsRemaining--;
459 LOG.info("{} test methods remaining", testMethodsRemaining);
463 public void testhwvtepsouthboundFeatureLoad() {
464 Assert.assertTrue(true);
468 public void testNetworkTopology() throws InterruptedException {
469 NetworkTopology networkTopology = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION,
470 InstanceIdentifier.create(NetworkTopology.class));
471 Assert.assertNotNull("NetworkTopology could not be found in " + LogicalDatastoreType.CONFIGURATION,
474 networkTopology = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL,
475 InstanceIdentifier.create(NetworkTopology.class));
476 Assert.assertNotNull("NetworkTopology could not be found in " + LogicalDatastoreType.OPERATIONAL,
481 public void testHwvtepTopology() throws InterruptedException {
482 InstanceIdentifier<Topology> path = InstanceIdentifier
483 .create(NetworkTopology.class)
484 .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID));
486 Topology topology = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, path);
487 Assert.assertNotNull("Topology could not be found in " + LogicalDatastoreType.CONFIGURATION,
490 topology = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, path);
492 Assert.assertNotNull("Topology could not be found in " + LogicalDatastoreType.OPERATIONAL,
497 public void testAddDeleteHwvtepNode() throws InterruptedException {
498 ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portNumber);
499 // At this point we're connected, disconnect and reconnect (the connection will be removed at the very end)
500 disconnectHwvtepNode(connectionInfo);
501 connectHwvtepNode(connectionInfo);
505 public void testAddDeletePhysicalSwitch() throws InterruptedException {
506 ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portNumber);
508 try (TestPhysicalSwitch testPSwitch = new TestPhysicalSwitch(connectionInfo, PS_NAME)) {
509 PhysicalSwitchAugmentation pSwitch = getPhysicalSwitch(connectionInfo);
510 Assert.assertNotNull(pSwitch);
511 LOG.info("PhysicalSwitch: {}", pSwitch);
515 private PhysicalSwitchAugmentation getPhysicalSwitch(ConnectionInfo connectionInfo) {
516 return getPhysicalSwitch(connectionInfo, PS_NAME);
519 private PhysicalSwitchAugmentation getPhysicalSwitch(ConnectionInfo connectionInfo, String psName) {
520 return getPhysicalSwitch(connectionInfo, psName, LogicalDatastoreType.OPERATIONAL);
523 private PhysicalSwitchAugmentation getPhysicalSwitch(ConnectionInfo connectionInfo, String psName,
524 LogicalDatastoreType dataStore) {
525 Node psNode = getPhysicalSwitchNode(connectionInfo, psName, dataStore);
526 Assert.assertNotNull(psNode);
527 PhysicalSwitchAugmentation psAugmentation = psNode.getAugmentation(PhysicalSwitchAugmentation.class);
528 Assert.assertNotNull(psAugmentation);
529 return psAugmentation;
532 private Node getPhysicalSwitchNode(ConnectionInfo connectionInfo, String psName, LogicalDatastoreType dataStore) {
533 InstanceIdentifier<Node> psIid =
534 HwvtepSouthboundUtils.createInstanceIdentifier(connectionInfo, new HwvtepNodeName(psName));
535 return mdsalUtils.read(dataStore, psIid);