ovsdb.git
4 years agodelete reconciliation support on termination points 07/82707/12
Chetan Arakere Gowdru [Tue, 25 Jun 2019 08:55:28 +0000 (14:25 +0530)]
delete reconciliation support on termination points

Descripion:
There exists chances of stale tunnel-ports left over under following
scenario.

1) DPN connected and Tunnel configuration pushed in by ODL.
2) DPN disconnected and Tunnel Configuation delete by ODL from
network-topology config DS.
3) On DPN connecting back, there exists stale tunnelport port on this
DPN.

Following Changes are done to handle delete reconciliation support.

1) Configure "created_by:odl" on tunnel port in OVS(Port, Interface)
which will be pushed by ovsdb plugin.
2) During reconcilation, compare the termination points available in
config and oper DS and trigger delete of those stale termination points
of Oper DS which are set with "created_by:odl"

JIRA: OVSDB-459

Change-Id: I9356d5ef0af44334c97b6cf3632d4ce9fd2070aa
Signed-off-by: Chetan Arakere Gowdru <chetan.arakere@altencalsoftlabs.com>
Signed-off-by: xcheara <chetan.arakere@altencalsoftlabs.com>
4 years agoBump to odlparent-6.0.1/yangtools-4.0.2/mdsal-5.0.4 32/85632/2
Robert Varga [Wed, 6 Nov 2019 16:32:25 +0000 (17:32 +0100)]
Bump to odlparent-6.0.1/yangtools-4.0.2/mdsal-5.0.4

This picks up latest upgrades and fixes.

Change-Id: I8db358b0af81394a561071d98bffea168dda47cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate MockitoJUnitRunner 58/84458/2
Robert Varga [Sat, 14 Sep 2019 19:00:39 +0000 (21:00 +0200)]
Migrate MockitoJUnitRunner

This migrates from org.mockito.runners.MockitoJUnitRunner to
org.mockito.junit.MockitoJUnitRunner.

Change-Id: I7311c18d01dd51f3ddaa5397c7f61ee3c143cb7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDo not use Foo.toString() when logging 00/85400/1
Robert Varga [Mon, 28 Oct 2019 07:25:36 +0000 (08:25 +0100)]
Do not use Foo.toString() when logging

This was spotted in a JFR run, where JsonRpcEndpoint would consume
a lot of CPU formatting a logging object. Eliminate calls to toString()
in logging arguments, as the framework will call these when really
needed.

Change-Id: Id077c285074c1fd8012539ab7c144ddc4b286376
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump mdsal to 5.0.3 69/85069/1
Robert Varga [Fri, 11 Oct 2019 14:13:26 +0000 (16:13 +0200)]
Bump mdsal to 5.0.3

This bumps mdsal to 5.0.3 to workaround issues with Blueprint
injection.

Change-Id: I848c9220ce06ec7b4af304ab64948bdc30257dbd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd a workaround for ARIES-1923 56/85056/1
Robert Varga [Fri, 11 Oct 2019 12:10:24 +0000 (14:10 +0200)]
Add a workaround for ARIES-1923

The services here may fail to resolve, causing problems downsteam.
This fixes up the issue by dropping target Java version to 10.

Change-Id: I226ba17183aa202209bbfbbe9ae2b87af7103383
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump mdsal to 5.0.2 42/84442/8
Robert Varga [Sat, 14 Sep 2019 06:57:45 +0000 (08:57 +0200)]
Bump mdsal to 5.0.2

This bumps mdsal to 5.0.2 as part of Magnesium MRI.

Change-Id: I93e10e95b7a241d678829afb732e2adef82c1a24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 6.0.0 41/84441/6
Robert Varga [Sat, 14 Sep 2019 06:57:23 +0000 (08:57 +0200)]
Bump odlparent to 6.0.0

This bumps odlparent to 6.0.0 as part of Magnesium MRI.

Change-Id: I084c6a32c4facafd85e3b87c6d8a9a29a33848a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUpdate docs header to Magnesium in the master 15/83815/2
Anushka Bhandari [Tue, 20 Aug 2019 16:53:10 +0000 (22:23 +0530)]
Update docs header to Magnesium in the master

Should be Magnesium on master and Sodium on stable/sodium.

Signed-off-by: Anushka Bhandari <anushka16134@iiitd.ac.in>
Change-Id: Ib32db17f852043beadda5932c300b16dbe431e79

4 years agoCheck TP type rather than doing a blind cast 69/84569/3
Robert Varga [Sun, 22 Sep 2019 01:26:22 +0000 (03:26 +0200)]
Check TP type rather than doing a blind cast

Here we have a blind cast, which does not go through:

[main] WARN org.opendaylight.ovsdb.hwvtepsouthbound.transact.TransactUtils - Failed to add to Transaction Histroy
java.lang.ClassCastException: org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint$$$codecImpl cannot be cast to org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalLocator
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.TransactUtils.addLocatorToTransactionHistory(TransactUtils.java:270)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.TransactUtils.createPhysicalLocatorSet(TransactUtils.java:139)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.McastMacsRemoteUpdateCommand.setLocatorSet(McastMacsRemoteUpdateCommand.java:135)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.McastMacsRemoteUpdateCommand.doDeviceTransaction(McastMacsRemoteUpdateCommand.java:93)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.McastMacsRemoteUpdateCommand.doDeviceTransaction(McastMacsRemoteUpdateCommand.java:1)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.AbstractTransactCommand.processDependencies(AbstractTransactCommand.java:125)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.McastMacsRemoteUpdateCommand.onConfigUpdate(McastMacsRemoteUpdateCommand.java:78)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.McastMacsRemoteUpdateCommand.updateMcastMacRemote(McastMacsRemoteUpdateCommand.java:65)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.McastMacsRemoteUpdateCommand.execute(McastMacsRemoteUpdateCommand.java:55)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.TransactCommandAggregator.execute(TransactCommandAggregator.java:73)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.TransactInvokerImpl.invoke(TransactInvokerImpl.java:41)
at org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionInstance.transact(HwvtepConnectionInstance.java:132)
at org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionInstance.transact(HwvtepConnectionInstance.java:104)
at org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepDataChangeListener.updateData(HwvtepDataChangeListener.java:178)
at org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepDataChangeListener.onDataTreeChanged(HwvtepDataChangeListener.java:81)
at org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataTreeChangeListenerAdapter.onDataTreeChanged(BindingDOMDataTreeChangeListenerAdapter.java:43)

Rather than incurring this, perform an instanceof check and debug
ignored data.

Change-Id: Icc3d1abe5afd2b9b60c7632606551904b7d27af7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate to use ArgumentMatchers 70/84570/2
Robert Varga [Sun, 22 Sep 2019 01:34:38 +0000 (03:34 +0200)]
Migrate to use ArgumentMatchers

org.mockito.Matchers.any() has been deprecated, use its newer
equivalent.

Change-Id: I46e4dd8000ab5a047da8414b5e9707b5f5e3b056
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump mdsal to 4.0.6 38/84438/5
Robert Varga [Sat, 14 Sep 2019 06:43:15 +0000 (08:43 +0200)]
Bump mdsal to 4.0.6

This picks up latest fixes.

Change-Id: I64e1f277bd00e132f40647eb0a2e7fc00eb56705
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 5.0.2 37/84437/4
Robert Varga [Sat, 14 Sep 2019 06:42:38 +0000 (08:42 +0200)]
Bump odlparent to 5.0.2

This bumps odlparent to pick up latest references.

Change-Id: I73af7ad69f686cb5bacc6ccfe0f57d226a43994b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix checkstyle 36/84436/1
Robert Varga [Sat, 14 Sep 2019 06:49:02 +0000 (08:49 +0200)]
Fix checkstyle

This fixes up checkstyle violations.

Change-Id: I7ee4391b58eef76954157deb11b611a3837d0960
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump mdsal to 4.0.4 30/83730/1
Robert Varga [Thu, 15 Aug 2019 08:44:20 +0000 (10:44 +0200)]
Bump mdsal to 4.0.4

This brings in latest fixes.

Change-Id: I59f89ef4fe76ef16fcdc9b59f8d9b50aa0849847
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump versions by x.y.(z+1) 54/83554/1
jenkins-releng [Mon, 12 Aug 2019 16:14:13 +0000 (16:14 +0000)]
Bump versions by x.y.(z+1)

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I876601792e0d95e76362d9fed8c1f2c9b0c4d553

4 years agoBump mdsal to 4.0.3 39/83139/3
Robert Varga [Thu, 18 Jul 2019 16:18:20 +0000 (18:18 +0200)]
Bump mdsal to 4.0.3

This bumps mdsal to 4.0.3, bringing in latest fixes and improvements.

Change-Id: Ie8e03aab1f31edf80bc9f1d7896c334c9d83be8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 5.0.1 38/83138/2
Robert Varga [Thu, 18 Jul 2019 16:14:02 +0000 (18:14 +0200)]
Bump odlparent to 5.0.1

This picks up the latest upgrades.

Change-Id: If6006a94197839a9718cd5eae16b0a025913af93
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoOptimization to read the HwvtepNode from the cache. 19/83319/2
Chandra Shekar S [Tue, 30 Jul 2019 10:08:03 +0000 (15:38 +0530)]
Optimization to read the HwvtepNode from the cache.

JIRA: OVSDB-485

Currently in the HwvtepSouthbound plugin reads the HwvtepNode from the datastore.
Reading the HwvtepNode from the datastore ineffecient, even the same info
is present in HwvtepSouthbound plugin cache.

This review is avoid the HwvtepNode reads from the datastore and get it from the cache.
If the node is not present in the cache, then read from datastore.

Signed-off-by: Chandra Shekar S <chandra.shekar.s@ericsson.com>
Change-Id: I1f15ff31b195a79a1725e63882512b87d40c5838

4 years agoOVSDB-486 Fix Null Pointer Exception in OVSDB 34/82734/4
Nobin Mathew [Tue, 11 Sep 2018 06:06:10 +0000 (11:36 +0530)]
OVSDB-486 Fix Null Pointer Exception in OVSDB

Fix for Null Pointer Exception

Change-Id: I93227ab66df4529a9b8c127c4b41096335424cc3
Signed-off-by: Nobin Mathew <nobin.mathew@ericsson.com>
4 years agoAvoid Bulk Topology Read During Reconciliation. 63/82563/11
Chetan Arakere Gowdru [Wed, 19 Jun 2019 06:12:32 +0000 (11:42 +0530)]
Avoid Bulk Topology Read During Reconciliation.

Description:
During Reconciliation, The full config network-topology DS is queried
which is not efficient. Currently, only br-int is managed in
network-toplogy config DS(by genius) which will only be resynced.

Changes are done to query only the list of bridges for a given connected
switch (configurable vi param - bridges-reconciliation-inclusion-list) from
topology config instead of querying the full topology from config DS and
filtering the bridges specific to connected Switch.Following
implementation been provided(to keep the existing behaviour)

(1) Both "bridge-reconciliation-inclusion-list" and "bridge-reconciliation-exclusion-list" are empty.
    it means it will keep the default behavior of reconciling on all bridges.
(2) Only "bridge-reconciliation-inclusion-list" has list of bridge.
    than plugin will only reconcile specified bridges.
(3) Only "bridge-reconciliation-exclusion-list" has list of bridge.
    than plugin will reconcile all the bridge, except excluding the specified bridges.
(4) Both bridge-reconciliation-inclusion-list and bridge-reconciliation-exclusion-list has bridges specified.
    this is invalid scenario, so it should log the warning saying this is not valid configuration,
    but plugin will give priority to "bridge-reconciliation-exclusion-list" and reconcile all the bridges
    except the one specified in the exclusion-list.

JIRA: OVSDB-459

Change-Id: Ife8055bcc10bcb6deb2fd8e0b5444bdf194f1460
Signed-off-by: Chetan Arakere Gowdru <chetan.arakere@altencalsoftlabs.com>
4 years agoKaraf cli command to display the hwvtep cache data 85/82885/3
Chandra Shekar S [Tue, 2 Jul 2019 10:09:41 +0000 (15:39 +0530)]
Karaf cli command to display the hwvtep cache data

JIRA: OVSDB-482

The hwvtep configuration data is pushed to the tor by the hwvtep plugin.
The hwvtep plugin has the caches (config and operational caches) which holds
the hwvtep configuration. The hwvtep configuration push to the tor is also
dependent on the data that is present in caches.
For ex : To push the vlanbinding data to the PhysicalPort , the operational
cache is checked first, if present in the operational cache get the uuid of
that PhysicalPort and the send/push the vlanbinding to the tor.

Today it is hard to know/check what is present in the cache. In case if there
any issue in updating the cache, it is hard to debug/analyse the issue as no way
to know what is present in the cache.

If we have mechanism/cli command which gives the information of the hwvtep
caches, it will be very helpful to debug or analyze such cache missing issues.

This is for adding the karaf cli command which displays the hwvtep caches contents.
This command has two options :
1. Hwvtep nodeid as the input. Displays cache information of input hwvtep node.
2. Without any input. Displays the cache information of all hwvtep nodes.

Change-Id: I4301a784d83aa28f5ef4737fc44d052f323e11df
Signed-off-by: Chandra Shekar S <chandra.shekar.s@ericsson.com>
4 years agoOptimizatoin to get the nodeIid from the DeviceOperCache in HwvtepPhysicalPortUpdateC... 61/82761/4
Chandra Shekar S [Thu, 27 Jun 2019 13:04:35 +0000 (18:34 +0530)]
Optimizatoin to get the nodeIid from the DeviceOperCache in HwvtepPhysicalPortUpdateCommand

JIRA: OVSDB-482

Description :
Currently in HwvtepPhysicalPortUpdateCommand while updating the terminationpoint the
nodeIid/switchIid is retrieved from the incoming event data, if not present in the
incoming event data, it is retrieved from the DataStore by looking/looping at all
switches for that node which is ineffecient. The logic has chances of throwing NPE when
there are no PhisicalSwitches present for that node in the DataStore.

The change is to retrieve the nodeIid from the deviceOperCache , if not present get it from the
DataStore. The change also contains the handling of the NPE while retrieving the data from DataStore

Change-Id: Ifbfad7eb9cdac1c2eedb29ea9eb2a303ac8a9a3c
Signed-off-by: Chandra Shekar S <chandra.shekar.s@ericsson.com>
4 years agoHwvtep TransactionHistory improvements. 33/82733/4
Chandra Shekar S [Wed, 26 Jun 2019 10:18:44 +0000 (15:48 +0530)]
Hwvtep TransactionHistory improvements.

JIRA: OVSDB-481

The change in this review is to improve the format of the Hwvtep TransctionHistory hwvtep:txlog command
1. The hwvtep:txlog output is not logging/printing the date correctly. The date that is getting
printed is the date at which the command is executed , not the date at the transaction is looged.
Change has the fix for date issue.

2. The hwvtep:txlog output format is printing the complete instance identifier information of the nodes.
  making the command output clumsy and hard to read.
  ex :
    Printing for iid KeyedInstanceIdentifier{targetType=interface org.opendaylight.yang.gen.v1.urn.tbd.
    params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node, path=
    org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology,
    org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.
    Topology[key=TopologyKey{_topologyId=Uri{_value=hwvtep:1}}],org.opendaylight.yang.gen.v1.urn.tbd.
    params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node[key=NodeKey{_nodeId=
    Uri{_value=hwvtep://uuid/3b0fb1b3-6449-4fa7-b6ac-0db437fe144e}}]]}
Update the output format only to print the node id : "hwvtep://uuid/3b0fb1b3-6449-4fa7-b6ac-0db437fe144e"

3. Update the TransctionHistory for the missing tables/objects like LogicalSwitch and Physical Port etc.
4. Added more logging of Transctions.

Change-Id: Ia5e8984fb414944820140acae69dd64104ee9619
Signed-off-by: Chandra Shekar S <chandra.shekar.s@ericsson.com>
4 years agoSpec for OVSDB reconciliation 45/71845/21
Nobin Mathew [Wed, 6 Jun 2018 17:12:38 +0000 (22:42 +0530)]
Spec for OVSDB reconciliation

JIRA: OVSDB-459
Change-Id: I913814e61a2bfc1a10bdbc4c65b3108208108cd1
Signed-off-by: Nobin Mathew <nobin.mathew@ericsson.com>
Signed-off-by: Chetan Arakere Gowdru <chetan.arakere@altencalsoftlabs.com>
4 years agoRemove use of StringBuffer 40/82640/1
Robert Varga [Fri, 21 Jun 2019 05:36:01 +0000 (07:36 +0200)]
Remove use of StringBuffer

StringBuilder is a faster replacement, use that instead of
StringBuffer.

Change-Id: I5baafddeefff469796cd33dea7056cc0d6a5f6c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUpdate docs/ovsdb-user-guide.rst and README 06/82406/1
Yi Yang [Wed, 5 Jun 2019 03:10:48 +0000 (23:10 -0400)]
Update docs/ovsdb-user-guide.rst and README

odl-ovsdb-openstack has been moved to netvirt and changed as
odl-netvirt-openstack, so update it to reflect current status.

JIRA: OVSDB-480

Change-Id: Ied1268898d0adc63894250b9733a974140bc31c4
Signed-off-by: Yi Yang <yangyi01@inspur.com>
5 years agoBump mdsal to 4.0.2 64/82364/2
Robert Varga [Fri, 31 May 2019 14:15:19 +0000 (16:15 +0200)]
Bump mdsal to 4.0.2

This picks up the latest fixes.

Change-Id: I60557d40e4ae849ea73f3232f20f7032205dbe65
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump mdsal to 4.0.1 47/81847/3
Robert Varga [Wed, 1 May 2019 11:50:28 +0000 (13:50 +0200)]
Bump mdsal to 4.0.1

This bumps mdsal to 4.0.1.

Change-Id: I23245cdccf757cf2c1c19a6774cc5fbb71382343
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAllow SouthboundUtils to work with MdsalUtils 22/82022/2
Robert Varga [Tue, 14 May 2019 09:47:54 +0000 (11:47 +0200)]
Allow SouthboundUtils to work with MdsalUtils

SouthboundUtils are being used by downstreams, who want to migrate
to MD-SAL APIs. Allow SouthboundUtils to work with both
ControllerMdsalUtils and MdsalUtils.

Change-Id: Iab6e48c060942e56db111755c08cd15206d38695
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup OvsdbDataTreeChangeListener 41/77841/9
Robert Varga [Thu, 15 Nov 2018 07:41:42 +0000 (08:41 +0100)]
Cleanup OvsdbDataTreeChangeListener

This patch restructures the logic a bit, so that it does not invoke
getData{After,Before}() multiple times, fixing Eclipse warnings and
improving performance.

Furthermore augmentation handling is refactored so that the two
cases (node/bridge) are handled in an if cascade, preserving type
safety.

Finally updateConnections() is refactored to use a switch statement
instead of multiple if conditions, which shows that delete of the
entire node are not handled -- a FIXME is placed there.

Change-Id: If5663ebd2944d7fe83c4928b96cedc0db0f90e19
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump mdsal to 4.0.0 58/81458/3
Robert Varga [Mon, 8 Apr 2019 23:10:20 +0000 (01:10 +0200)]
Bump mdsal to 4.0.0

This bumps mdsal to 4.0.0 as part of Sodium MRI.

Change-Id: I7c4c8956623072e402371147e58e9cc2a2e4bf78
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump odlparent to 5.0.0 57/81457/2
Robert Varga [Mon, 8 Apr 2019 23:09:29 +0000 (01:09 +0200)]
Bump odlparent to 5.0.0

This bumps odlparent to 5.0.0 as part of Sodium MRI, also migrates
simple use of JSR305 to JDT.

Change-Id: Ie115a811e9f1a13e0ed4d3e1008270b589b4bdcc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix logging arguments 56/81456/1
Robert Varga [Mon, 8 Apr 2019 23:21:08 +0000 (01:21 +0200)]
Fix logging arguments

These are issues pointed out by updated SpotBugs, fix them up.

Change-Id: I2e740a1e23b96cbe12e4a49b0ca306876c5a713b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove use of deprecated Guava methods 55/81455/1
Robert Varga [Mon, 8 Apr 2019 23:16:05 +0000 (01:16 +0200)]
Remove use of deprecated Guava methods

Pass down MoreExecutors.directExecutor() to future-proof the code.

Change-Id: Iaf847f2dbcce63bac685d5a22a35fc9b8085d06d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpgrade powermock to 2.0.0 74/80774/16
Robert Varga [Mon, 11 Mar 2019 14:18:49 +0000 (15:18 +0100)]
Upgrade powermock to 2.0.0

This upgrades powermock to version 2.0.0, also updating tests to
match nulls being returned through mocks.

JIRA: OVSDB-476
Change-Id: I54beb2db411cff0e126c8e8208ff9ee1530437ab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix static mocking in TransactUtilsTest 85/80785/1
Robert Varga [Mon, 11 Mar 2019 18:30:46 +0000 (19:30 +0100)]
Fix static mocking in TransactUtilsTest

Change static mocks to doReturn().when(...) mocking style, which
allows them to properly work with Mockito 2.

Change-Id: Ie5b2f0223fd67b942a5c77cd56f5ccaa4fa870e1
JIRA: OVSDB-476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix SouthboundUtilTest 84/80784/2
Robert Varga [Mon, 11 Mar 2019 17:34:13 +0000 (18:34 +0100)]
Fix SouthboundUtilTest

Use PowerMockito.doReturn() to correctly mock static method invocation,
enabling the test to pass.

Change-Id: I7d999ed1ca3720877ea8ee9e6d59a267604f3409
JIRA: OVSDB-476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove unnecessary stubbing 83/80783/5
Robert Varga [Mon, 11 Mar 2019 17:13:12 +0000 (18:13 +0100)]
Remove unnecessary stubbing

This fixes interop with Mockito 2, allowing the suite to pass
further.

Change-Id: I22c65f2b3a0f732c2b6bea6554ad4d75aa520f82
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix OvsdbConnectionManagerTest 80/80780/1
Robert Varga [Mon, 11 Mar 2019 16:47:09 +0000 (17:47 +0100)]
Fix OvsdbConnectionManagerTest

Fix mock returns to use proper types, so this works with Mockito2,
too.

Change-Id: I277ade6a61978bd829c437fb9a90fc91d58045f2
JIRA: OVSDB-476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix OvsdbManagersRemovedCommandTest 78/80778/2
Robert Varga [Mon, 11 Mar 2019 16:26:19 +0000 (17:26 +0100)]
Fix OvsdbManagersRemovedCommandTest

Use proper mocking to return non-null values when intercepting
methods.

Change-Id: Ic70d6696ce869d91d8de72859130f758d68de830
JIRA: OVSDB-476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix OvsdbConnectionInstanceTest 73/80773/4
Robert Varga [Mon, 11 Mar 2019 15:18:16 +0000 (16:18 +0100)]
Fix OvsdbConnectionInstanceTest

Remove unnecessary stubbing and fix any()/mock() confusion.

JIRA: OVSDB-476
Change-Id: I7621f67e3af5d1191c0a51e3356d257263991202
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix OpenVSwitchUpdateCommandTest 79/80779/1
Robert Varga [Mon, 11 Mar 2019 16:30:09 +0000 (17:30 +0100)]
Fix OpenVSwitchUpdateCommandTest

There is some unnecessary stubbing, remove it to ease migration.

JIRA: OVSDB-476
Change-Id: Ie8222eaa524a5fabb9b054e6076a3377708c7248
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove ProtocolUpdateCommandTest 75/80775/2
Robert Varga [Mon, 11 Mar 2019 15:48:15 +0000 (16:48 +0100)]
Remove ProtocolUpdateCommandTest

This test is not verifying anything, remove it.

Change-Id: I81ebccd450d888adfd66420f90cfbcd907996c4d
JIRA: OVSDB-476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove OvsdbControllerRemovedCommandTest 71/80771/1
Robert Varga [Mon, 11 Mar 2019 14:23:38 +0000 (15:23 +0100)]
Remove OvsdbControllerRemovedCommandTest

This test is using partial mocking to the point of not checking
anything real and actually verifies incorrect internal method
signatures. Remove it.

JIRA: OVSDB-476
Change-Id: I04e67ff6937e84cdc55e1347e407596df8605c99
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse JDT annotations instead of JSR-305 33/80233/4
Stephen Kitt [Fri, 8 Feb 2019 10:11:03 +0000 (11:11 +0100)]
Use JDT annotations instead of JSR-305

This reduces our dependencies on javax.annotation, which end up
causing problems with Java 11.

Change-Id: Ied3be5b9677bef722c008b2828950bb12ae84678
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoDo not workaround MDSAL errors 68/80268/2
Robert Varga [Mon, 11 Feb 2019 16:13:09 +0000 (17:13 +0100)]
Do not workaround MDSAL errors

This code masked an MD-SAL failure to account for UNMODIFIED nodes,
which luckily had no effect. Upstream has this fix in the pipeline,
this patch removes the workaround.

Change-Id: I150a50c46e3272a0b099030f4424628ed983edff
JIRA: MDSAL-422
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoReduce use of powermockito 08/80208/2
Robert Varga [Thu, 7 Feb 2019 12:32:34 +0000 (13:32 +0100)]
Reduce use of powermockito

Remove unneeded supressions and mocking, with judicious reuse
of existing methods, @VisibleForTesting and similar.

Change-Id: If6aff32331d2a50752f5cd2ef981abe4d49f0af5
JIRA: OVSDB-476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove useless tests 07/80207/1
Robert Varga [Thu, 7 Feb 2019 13:38:48 +0000 (14:38 +0100)]
Remove useless tests

These tests are not asserting anything at all, remove them to reduce
static mocking proliferation for no value whatsoever.

Change-Id: I53b21da97d7b9c7cf6e64543e6fe73f2c08267e9
JIRA: OVSDB-476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoReduce use of powermockito 05/80205/2
Robert Varga [Thu, 7 Feb 2019 10:43:00 +0000 (11:43 +0100)]
Reduce use of powermockito

Rather than mucking with powermock, use Mockito's partial mocking
on a real instance of HwvtepConnectionManager.

Also proper application of @VisibleForTesting and ovsdbClient mocking
allows us to not mock HwvtepConnectionInstance at all.

We also have a simple utility for setting final fields, use that
to reset Operations static field -- allowing us to not use powermock
in DataChangeListenerTestBase at all.

JIRA: OVSDB-476
Change-Id: I6c321c0455fb886dc0029b2a321f73eb3ba150d1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove odlparent overrides 42/80142/3
Robert Varga [Mon, 4 Feb 2019 21:24:32 +0000 (22:24 +0100)]
Remove odlparent overrides

This removes unneeded overrides of odlparent-exported artifacts.

Change-Id: I7ee16354e180609babc65b1fb0a80d005489355b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSwitch to spotbugs plugin 41/80141/4
Robert Varga [Mon, 4 Feb 2019 21:05:05 +0000 (22:05 +0100)]
Switch to spotbugs plugin

findbugs does not work JDK9+, switch to spotbugs.

Change-Id: I2672369099c7298c67f9d50acec2bbdb882fb1d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpgrade powermock utils/ 40/80140/4
Robert Varga [Mon, 4 Feb 2019 21:02:10 +0000 (22:02 +0100)]
Upgrade powermock utils/

This upgrades powermock and fixes up warnings around mockito
being deprecated.

Change-Id: I74fe7b16b223ee9bab966478f6a653281634b8d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump versions by x.y.(z+1) 94/80094/1
jenkins-releng [Fri, 1 Feb 2019 13:06:31 +0000 (13:06 +0000)]
Bump versions by x.y.(z+1)

Change-Id: I21c38dd91233b8652a2a15d0cc9badb08c9e1931
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
5 years agoRemove duplicate artifact declarations 35/80035/3
Robert Varga [Wed, 30 Jan 2019 16:19:53 +0000 (17:19 +0100)]
Remove duplicate artifact declarations

This fixes a few maven warnings about artifacts being declared
multiple times.

Change-Id: Ib6a7a31931883009868f6e4150a8cb0ed5718fd6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoutils: migrate to the mdsal DataBroker 93/79993/2
Stephen Kitt [Tue, 29 Jan 2019 14:56:45 +0000 (15:56 +0100)]
utils: migrate to the mdsal DataBroker

This duplicates controller-based classes temporarily, so that we can
migrate hwvtepsouthbound and southbound separately.

Change-Id: I1ed7c137423deb149320df86f0abc090e1182df5
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agolibrary: migrate to the mdsal DataBroker 88/79988/2
Stephen Kitt [Tue, 29 Jan 2019 10:02:25 +0000 (11:02 +0100)]
library: migrate to the mdsal DataBroker

Change-Id: I0540965fe40521dd2d18e2206fb2bb874e2f1e72
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoAdd missing annotation dependencies for Java 11 98/79998/1
Stephen Kitt [Tue, 29 Jan 2019 17:34:23 +0000 (18:34 +0100)]
Add missing annotation dependencies for Java 11

Change-Id: I552dc74b2bb6832cc5419f309470a43430294443
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agouse annotations instead of XML for Blueprint 82/79782/6
Harshini [Mon, 21 Jan 2019 08:40:49 +0000 (14:10 +0530)]
use annotations instead of XML for Blueprint

JIRA: OVSDB-474
Change-Id: Ie40dacf4b4a745d77d83bdc7e1b95fecad4fd276
Signed-off-by: Harshini <hm@luminanetworks.com>
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
5 years agoBump to mdsal 3.0.6 07/79807/1
Stephen Kitt [Tue, 22 Jan 2019 08:50:39 +0000 (09:50 +0100)]
Bump to mdsal 3.0.6

Change-Id: Id4a938a3e8d8669b972df17ddf1d76f91ca686d0
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoBump mdsal to 3.0.5 87/79787/1
Robert Varga [Mon, 21 Jan 2019 09:25:09 +0000 (10:25 +0100)]
Bump mdsal to 3.0.5

This aligns with odlparent-4.0.9 and yangtools-2.1.8.

Change-Id: I1800398e0f1cfbfc263164ea6eff878423d31b98
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 4.0.9 75/79675/1
Stephen Kitt [Fri, 18 Jan 2019 15:33:50 +0000 (16:33 +0100)]
Bump to odlparent 4.0.9

Change-Id: Iabeeaae5001bb0fba3c84d22cedd82444b60f7b8
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoBump mdsal to 3.0.4 37/79437/1
Robert Varga [Thu, 10 Jan 2019 15:53:07 +0000 (16:53 +0100)]
Bump mdsal to 3.0.4

This realigns odlparent/yangtools/mdsal and brings in the latest
improvements.

Change-Id: I6db0663fcf132b9e01839c2cc14dc611ea75aa60
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump odlparent to 4.0.8 22/79122/3
Stephen Kitt [Wed, 2 Jan 2019 10:24:57 +0000 (11:24 +0100)]
Bump odlparent to 4.0.8

Change-Id: Ieee47dc9a810d99311bb1bfdeedc71655a612cab
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoFix controller for ptcp manager 29/79229/1
Vishal Thapar [Fri, 4 Jan 2019 12:51:53 +0000 (18:21 +0530)]
Fix controller for ptcp manager

If a ptcp manager is set on OVS, we configure
controller through conneciton info. There are two
issues with this code today:

1. Doesn't work well for IPv6.
2. Doesn't check if connection is to same port
   as configured in ptcp manager.

So we end up with an improper controller configured
basde on ptcp even if we already configured correct
ones from manager entries.

JIRA: OVSDB-475

Change-Id: Ic69be0a9a6f2fd96085b60cdc3ccb9f1022b54a8
Signed-off-by: Vishal Thapar <vthapar@redhat.com>
5 years agoMigrate NumberUtils.isNumber() 79/79179/1
Robert Varga [Thu, 3 Jan 2019 14:14:08 +0000 (15:14 +0100)]
Migrate NumberUtils.isNumber()

This method is deprecated, use its replacement, isCreatable().

Change-Id: I47a6dc48e5da306f8a1c2fa2e0a19ca034756c28
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove use StringUtils 75/79175/1
Robert Varga [Thu, 3 Jan 2019 13:20:24 +0000 (14:20 +0100)]
Remove use StringUtils

Guava provides equivalent functionality, use that instead of
commons-lang3.

Change-Id: Ide5fb6606ea51d6a65518e5e57422b11c259d86a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump mdsal to 3.0.3 28/79028/2
Robert Varga [Mon, 24 Dec 2018 17:50:29 +0000 (18:50 +0100)]
Bump mdsal to 3.0.3

This brings in latest fixes and alignes with odlparent-4.0.5.

Change-Id: I4626267cb5d322378e87b82045dd4f080a747e35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 4.0.5 20/78920/2
Stephen Kitt [Fri, 21 Dec 2018 09:11:21 +0000 (10:11 +0100)]
Bump to odlparent 4.0.5

Change-Id: Ib2f5fd0e462e8a1efdefc2e4e94acc109c688c19
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoUse targeted node type for bridge name search 21/77721/2
Stephen Kitt [Tue, 13 Nov 2018 13:31:20 +0000 (14:31 +0100)]
Use targeted node type for bridge name search

The IdentifiableItem we're looking for when checking for a bridge name
is Node; this changes isBridgeOnOvsdbNode() to look for that
directly. If also changes toString() to a match-specific method to
avoid the temptation to use it for other purposes.

Change-Id: Ib20e2c909098af9e0643f12805d98c5f2a66b651
JIRA: OVSDB-470
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoreduce object allocation in SouthboundUtils.isBridgeOnOvsdbNode() 19/77719/2
Michael Vorburger [Tue, 13 Nov 2018 11:08:33 +0000 (12:08 +0100)]
reduce object allocation in SouthboundUtils.isBridgeOnOvsdbNode()

By avoiding any unnecessary toString() usage, but unfortunately not
being able to complete avoid it, without further/bigger/riskier changes.

This should help to reduce GC churn.

JIRA: OVSDB-470
Change-Id: I86cdba3c138a79b428acf960a2ddb035f2878ca9
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
5 years agoBump to mdsal-3.0.2 51/78151/3
Robert Varga [Mon, 26 Nov 2018 09:29:09 +0000 (10:29 +0100)]
Bump to mdsal-3.0.2

This bumps the dependency to 3.0.2.

Change-Id: I4ab38f4dce8983e310430328c4367c732a5af3ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFixes overwrite when adding termination point 21/78221/3
Tim Rozet [Tue, 27 Nov 2018 16:44:53 +0000 (11:44 -0500)]
Fixes overwrite when adding termination point

A race condition was observed where OVSDB had already added the VTEP TP
to br-int, and following this Netvirt ELAN Manager added the patch port
(br-ex-patch) to br-int. Upon ELAN manager adding this using
SouthboundUtils addTerminationPoint, the previous VTEP was deleted. This
change modifies the addTerminationPoint to use a merge in MDSAL rather
than a put.

JIRA: OVSDB-472

Change-Id: I2afa7dc33ef915856774f431dd4c3d9bcd029155
Signed-off-by: Tim Rozet <trozet@redhat.com>
5 years agoLog the address and port on bind errors 51/78251/1
Stephen Kitt [Wed, 28 Nov 2018 10:01:47 +0000 (11:01 +0100)]
Log the address and port on bind errors

This ensures the address and port are available in the logs when we
fail to bind.

Change-Id: Iae6a6fd4d6f516d5dbd562a335d081181cff3b17
JIRA: OVSDB-473
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoFix ovsdb compilation 78/77578/1
Robert Varga [Wed, 7 Nov 2018 11:51:03 +0000 (12:51 +0100)]
Fix ovsdb compilation

southbound-impl relied on getting its dependencies transitively:
- sal-binding-api via aaa
- mdsal-dom-api via sal-core-api

Fix this up by specifying correct dependencies.

Change-Id: Iba60e8978c29a82f77c42d7ce1ee6052613fdcea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoInject the certificate manager in the constructor 47/76947/3
Stephen Kitt [Fri, 12 Oct 2018 10:06:53 +0000 (12:06 +0200)]
Inject the certificate manager in the constructor

This simplifies wiring in other contexts (e.g. with Blueprint
annotations or Guice).

Change-Id: If76dae1ec26d3ef3e3488788b6a5b77d99bb70a1
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoUpgrade to Neon base platform 89/76389/17
Vishal Thapar [Thu, 20 Sep 2018 15:08:36 +0000 (20:38 +0530)]
Upgrade to Neon base platform

This reverts the PowerMock and Mockito upgrades for the time being.

Change-Id: I46d935fed3ef44dede188ffd25295586010cc8a2
Signed-off-by: Vishal Thapar <vthapar@redhat.com>
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpdate docs header to Neon on master 88/76888/2
Daniel Farrell [Thu, 11 Oct 2018 15:40:32 +0000 (15:40 +0000)]
Update docs header to Neon on master

This version name gets rendered into the main header of OVSDB's docs.

Now that these docs have moved from the docs repo to project-owned
repos, projects need to update this version themselves.

Should be Neon on master and Fluorine on stable/fluorine.

Change-Id: I82a4bffc06a894bbc643c496c0471f3fe413a280
Jira: DOCS-112
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
5 years agoClose old OVSDB connection when ping fails 30/75430/4
Victor Pickard [Thu, 23 Aug 2018 17:09:13 +0000 (13:09 -0400)]
Close old OVSDB connection when ping fails

When rebooting a compute node, the ovsdb hostconfig is missing
from oper d/s.

The change resolves the issue, by closing the connection if
the ping/echo fails. The ping/echo is triggered when a new
connection comes in.

What was happening before this change, is that the new
connection from the rebooted compute node would be rejected
and closed, because the code saw an existing connection, and
had not yet "closed" the old connection, which would fail later,
about 3 seconds later.

Tested this with queens/oxygen by manually rebooting compute node
(sudo shutdown -r now) a number of times.

Many more details in the JIRA.

JIRA: OVSDB-444

Change-Id: I0c7e53b032fd53d0287bc28ae86f7ebda06cfabe
Signed-off-by: Victor Pickard <vpickard@redhat.com>
5 years agofix broken build 28/76828/1
Michael Vorburger [Wed, 10 Oct 2018 16:56:13 +0000 (18:56 +0200)]
fix broken build

due to today's I4f16674ba65f499944e4582fb900d90e873d14e2 (INFRAUTILS-51)

by using the new TestSystemReadyMonitor from infrautils ready
introduced in I545195b1b976f5951d2dc8e9599e7ab33bc407e9

Change-Id: I42cd734fa8df276b52112139b244b5846b6d7ba9
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
5 years agoavoid any extra memory allocation in Version.fromString() 90/76290/2
Michael Vorburger [Thu, 20 Sep 2018 03:34:38 +0000 (05:34 +0200)]
avoid any extra memory allocation in Version.fromString()

as this is called a lot, it's (apparently, Java Mission Control on a
scale lab test shows) worth it to avoid the RegExp Matcher and x3
intermediate String object allocations, which we can safe here by
implementing this a little smarter (lower level; feels like 6502!).

JIRA: OVSDB-469
Change-Id: I642e0bfd698e594d3c263f0a335b92f80fbde8c4
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
5 years agoIncorrect IPv6 address for controller 57/75157/6
Vishal Thapar [Mon, 13 Aug 2018 07:31:57 +0000 (13:01 +0530)]
Incorrect IPv6 address for controller

getControllersFromOvsdbNode() method to uses ':' as
delimiter for protocol, IP and Port, which is broken
by IPv6 addresses which use : as delimiters for address
octets.

Fix is to handle IPv6 addresses differently.

JIRA: OVSDB-466
Change-Id: Ifc7070d0d3ba5e60a124dc612cdfc66cafa1527b
Signed-off-by: Vishal Thapar <vthapar@redhat.com>
5 years agofix broken build by adding new SystemReadyMonitor getFailureCause() impl 88/75488/1
Michael Vorburger [Mon, 27 Aug 2018 08:19:11 +0000 (10:19 +0200)]
fix broken build by adding new SystemReadyMonitor getFailureCause() impl

impact of I2420c5440366daee626da9b0ea62bbe322bc1cde

JIRA: INFRAUTILS-48
Change-Id: Ifa7255497361a17ab52784616b908efdde6f2dcd
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
5 years agoRemove references to mdsal-model-artifacts 26/75126/1
Robert Varga [Sat, 11 Aug 2018 07:51:29 +0000 (09:51 +0200)]
Remove references to mdsal-model-artifacts

This artifact is going away, migrate to mdsal-artifacts.

Change-Id: Iad90d1107f4b407dfd947761d96e97311496b759
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump versions by x.(y+1).z for next dev cycle 99/74999/1
Anil Belur [Thu, 9 Aug 2018 12:40:15 +0000 (18:10 +0530)]
Bump versions by x.(y+1).z for next dev cycle

Change-Id: Id12d87739bba0216b9d0650b5bfce6a1eac91dbf
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
5 years agoCleanup API assumptions 08/74608/5
Robert Varga [Sat, 28 Jul 2018 10:24:06 +0000 (12:24 +0200)]
Cleanup API assumptions

Migrate Identifier.Item use and allow DataObjectModification
to return a collection of implementations.

JIRA: MDSAL-342
Change-Id: I65e398ca6d6c1aabbd5a12eb75601cafb551d22e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 3.1.3 04/74204/2
Stephen Kitt [Wed, 18 Jul 2018 16:06:42 +0000 (18:06 +0200)]
Bump to odlparent 3.1.3

Change-Id: If4a96d68f7e1bd195adb05149641538420c8afe6
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoMove OVSDB documentation from docs 42/74342/1
Vishal Thapar [Mon, 23 Jul 2018 15:01:04 +0000 (20:31 +0530)]
Move OVSDB documentation from docs

Move OVSDB docs hosted in docs project
to OVSDB/docs.

Change-Id: Iac705f47a8b8a68662bd880b101bca32d4d719b1
Signed-off-by: Vishal Thapar <vthapar@redhat.com>
5 years agoUse union's stringValue() method 61/74061/25
Robert Varga [Mon, 16 Jul 2018 09:34:08 +0000 (11:34 +0200)]
Use union's stringValue() method

getValue() clashes which user-derived names, migrate to stringValue(),
which also has a better type.

Change-Id: I66ca094de9fa378f576e75f1dbb057e7daee70f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not mock IpAddress 74/74174/10
Robert Varga [Wed, 18 Jul 2018 02:54:02 +0000 (04:54 +0200)]
Do not mock IpAddress

There really is no need, we can use the generated implementation.

Change-Id: Ibe2514588385f54e1cca2fe4f1631f3f87b63389
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not mock Ipv4Address 73/74173/9
Robert Varga [Wed, 18 Jul 2018 02:51:22 +0000 (04:51 +0200)]
Do not mock Ipv4Address

There really is no need, we can use the generated implementation.

Change-Id: I11f5b6b6c026ae211f6ca365aea19a6e17601731
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not mock enumeration 72/74172/8
Robert Varga [Wed, 18 Jul 2018 02:49:34 +0000 (04:49 +0200)]
Do not mock enumeration

This reworks mocking to eliminate open-mocked implementation, but
rather use a Guava implementation.

Change-Id: Ie4d557ca09a06d206c11160219687c006b8d2d07
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPull in minimal set of models 26/74126/3
Robert Varga [Tue, 17 Jul 2018 14:53:14 +0000 (16:53 +0200)]
Pull in minimal set of models

Rather than pulling in all mdsal models, require on the models
we specifically need.

JIRA: MDSAL-363
Change-Id: I63e2f4a01a82e361dd2847fed6796461692ba903
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not mock InetAddress 70/74170/4
Robert Varga [Wed, 18 Jul 2018 02:32:39 +0000 (04:32 +0200)]
Do not mock InetAddress

Rather than mocking it, create a known-good constant and rely on it.

Change-Id: I10fc205c122a77f94a7851a6fe38e9252bac73af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove an unneded explicit cast 61/74161/4
Robert Varga [Tue, 17 Jul 2018 22:18:14 +0000 (00:18 +0200)]
Remove an unneded explicit cast

Implicit cast does better here, as inference works out nullness
mapping.

Change-Id: If1b7ecd8179290fae5b81151e0634b4b9a48d01f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMove unchecked warnings 60/74160/5
Robert Varga [Tue, 17 Jul 2018 22:16:44 +0000 (00:16 +0200)]
Move unchecked warnings

Tagging specific statements is better here, as there are only two. It makes
the method better protected and the code is more readable
('here I need to do a cast, which is deemed unsafe').

Change-Id: I7cb8fcfbe1080e6e869fff1de4ba227f84a78eeb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoExpose methods for testing 62/74162/2
Robert Varga [Tue, 17 Jul 2018 22:47:58 +0000 (00:47 +0200)]
Expose methods for testing

Using @VisibleForTesting to expose a method from private to package-private,
hence we do not need to use WhiteBox reflection and can do direct calls.

Change-Id: Ic6101b560595a74faaf7889dc496025f7eaf4a7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not squash PortNumber instances in test 19/74119/1
Robert Varga [Tue, 17 Jul 2018 13:01:09 +0000 (15:01 +0200)]
Do not squash PortNumber instances in test

There is no need to squash all PortNumbers to one instance, hence
reduce the use of mockito.

Change-Id: I403f6a12f1ccc6227830f40e6ee81476ae4b1488
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEliminate unneeded mocking of static methods 16/74116/2
Robert Varga [Tue, 17 Jul 2018 12:03:14 +0000 (14:03 +0200)]
Eliminate unneeded mocking of static methods

We really do not need to override behavior of contructors and
static methods, do not do that.

Change-Id: I6f2b3c31b9a3a17b42d106d97498176a0e955fbf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not mock generated classes 15/74115/1
Robert Varga [Tue, 17 Jul 2018 11:47:55 +0000 (13:47 +0200)]
Do not mock generated classes

These is no point in mocking classes which deliver well-defined
functionality. Just use them without mocking their contents.

Change-Id: I2dc91f2a1f383a163ebaed07f040ab416db5f17f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>