1137a972 | 20-Apr-2019 |
William A. Kennington III <wak@google.com> |
util: Clean up MAC address formatting
We should be using the built in ether_addr type wherever we want to reference the MAC address in byte form. This gets rid of the integer MAC type and makes func
util: Clean up MAC address formatting
We should be using the built in ether_addr type wherever we want to reference the MAC address in byte form. This gets rid of the integer MAC type and makes functions that consistently take the byte form of the MAC where possible.
Change-Id: Ic9e3eae8b5608ef517416215fb336871911975cc Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
f51620dd | 21-Apr-2019 |
William A. Kennington III <wak@google.com> |
test: Remove unused mock
This just spews out lots of warnings, and the mock interface is never used. This makes it harder to analyze with test failures.
Change-Id: I5c71da0806012dd5945f2f7ca19eb27b
test: Remove unused mock
This just spews out lots of warnings, and the mock interface is never used. This makes it harder to analyze with test failures.
Change-Id: I5c71da0806012dd5945f2f7ca19eb27b538c9571 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
6ca08d8d | 20-Apr-2019 |
William A. Kennington III <wak@google.com> |
types: Remove custom MacAddr type
The standard library has an ether_addr type that does the same job.
Change-Id: I98685b0b60dd07453ae2362adb33e0a7c9c3132c Signed-off-by: William A. Kennington III <
types: Remove custom MacAddr type
The standard library has an ether_addr type that does the same job.
Change-Id: I98685b0b60dd07453ae2362adb33e0a7c9c3132c Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
c920bdb8 | 19-Apr-2019 |
William A. Kennington III <wak@google.com> |
neighbor: Refactor out netlink code
This will allow us to re-use the generic netlink bits for other netlink request operations.
Adds test coverage to the netlink message parsing routines for sanity
neighbor: Refactor out netlink code
This will allow us to re-use the generic netlink bits for other netlink request operations.
Adds test coverage to the netlink message parsing routines for sanity and regression prevention.
Tested: Neighbor population still works when static neighbors are created on the BMC.
Change-Id: I755e86eb76a8f6f825616c13279328134de87da9 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
0420c6ac | 27-Jun-2019 |
William A. Kennington III <wak@google.com> |
build: Apply fixes to accommodate build system updates
- Fixes clang-format changes for version 6 -> 8 - Fixes possible strncpy trunction error - Fix for an optional std::variant behavior changed
build: Apply fixes to accommodate build system updates
- Fixes clang-format changes for version 6 -> 8 - Fixes possible strncpy trunction error - Fix for an optional std::variant behavior changed in gcc9
Change-Id: I80fe43b261e9b17ba662f17ea2854bd1fb6f1d61 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
08505793 | 30-Jan-2019 |
William A. Kennington III <wak@google.com> |
Static neighbor support
This changes adds support for assigning static ARP / NDP neighbors on each ethernet interface.
Tested: Ran inside a romulus VM and made sure that `ip neigh add` comm
Static neighbor support
This changes adds support for assigning static ARP / NDP neighbors on each ethernet interface.
Tested: Ran inside a romulus VM and made sure that `ip neigh add` commands triggered the refresh of static_neighbor objects. Also verified that static neighbors could be added through the CreateStatic dbus interface. Verified that deleting those static entries would persist to the system.
Change-Id: Ifaf753525c532b6dade392d7eb4ebd6d7242d480 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
4966e96e | 08-Apr-2019 |
William A. Kennington III <wak@google.com> |
util: Use standard ether functions for conversion
This should be slightly faster and is more standard for interop with other programs using the same conversion functions.
Change-Id: I4d7a2cb4df2173
util: Use standard ether functions for conversion
This should be slightly faster and is more standard for interop with other programs using the same conversion functions.
Change-Id: I4d7a2cb4df2173afda421c5b41ee5e98e722d6c6 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
04c3d714 | 07-Jan-2019 |
Patrick Venture <venture@google.com> |
test: rtnetlink: use manager interface query
Use the new interface query method provided by manager to know if the interface was added instead of inspecting the manager itself.
Change-Id: I94600199
test: rtnetlink: use manager interface query
Use the new interface query method provided by manager to know if the interface was added instead of inspecting the manager itself.
Change-Id: I94600199fd60a014d6b376155555449f7af617f5 Signed-off-by: Patrick Venture <venture@google.com>
show more ...
|
3f19a51e | 07-Jan-2019 |
Patrick Venture <venture@google.com> |
test: use mocked sdbus interface for sdbusplus
Use mocked sdbus interface for sdbusplus such that it doesn't require talking to the real dbus interfaces.
The warnings for the unexpected calls on th
test: use mocked sdbus interface for sdbusplus
Use mocked sdbus interface for sdbusplus such that it doesn't require talking to the real dbus interfaces.
The warnings for the unexpected calls on the sdbus interface can be ignored in the cases for this test as returning 0 is the desired behavior. The warnings can be trivially handled by expecting the calls, or setting up "ON_CALL" statements.
Change-Id: I8c72eaec957fb6a68eeaac982c1f45998487c35f Signed-off-by: Patrick Venture <venture@google.com>
show more ...
|
a973340f | 07-Jan-2019 |
Patrick Venture <venture@google.com> |
test: use system-first search for dbus interfaces
Use system-first search for inclusion of dbus interface headers.
Change-Id: I9953ca047c09c1003c86b1ffaf929698c157139c Signed-off-by: Patrick Ventur
test: use system-first search for dbus interfaces
Use system-first search for inclusion of dbus interface headers.
Change-Id: I9953ca047c09c1003c86b1ffaf929698c157139c Signed-off-by: Patrick Venture <venture@google.com>
show more ...
|
8fe594cf | 07-Jan-2019 |
Patrick Venture <venture@google.com> |
test: use expect_throw to catch expected exceptions
Use expect_throw to catch expected exceptions in tests.
Change-Id: I410655a43328d44c5b9f95dff509c132499bcd07 Signed-off-by: Patrick Venture <vent
test: use expect_throw to catch expected exceptions
Use expect_throw to catch expected exceptions in tests.
Change-Id: I410655a43328d44c5b9f95dff509c132499bcd07 Signed-off-by: Patrick Venture <venture@google.com>
show more ...
|
d94d23e9 | 07-Jan-2019 |
Patrick Venture <venture@google.com> |
test: use real manager object for testing
Use the real manager object for testing the manager object instead of a derived object.
Change-Id: I3b4a401d43457bffb22de8fac5e29b2e2887c6c6 Signed-off-by:
test: use real manager object for testing
Use the real manager object for testing the manager object instead of a derived object.
Change-Id: I3b4a401d43457bffb22de8fac5e29b2e2887c6c6 Signed-off-by: Patrick Venture <venture@google.com>
show more ...
|
a14879e1 | 01-Feb-2019 |
William A. Kennington III <wak@google.com> |
util: Add a MacAddr population function
This one is pretty trivial since there is only one size of mac address, but we want to be sure we validate the buffer.
Tested: Built and runs through uni
util: Add a MacAddr population function
This one is pretty trivial since there is only one size of mac address, but we want to be sure we validate the buffer.
Tested: Built and runs through unit tests. Works when integrated into neighbor parsing code.
Change-Id: Iaf58fc398b51a3bcbbf70968cbe353beeb7b9f54 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
a00b1c3f | 01-Feb-2019 |
William A. Kennington III <wak@google.com> |
util: Add InAddrAny population function
We commonly want to be able to turn netlink network order address data into the corresponding InAddrAny when parsing netlink data. This makes it trivial given
util: Add InAddrAny population function
We commonly want to be able to turn netlink network order address data into the corresponding InAddrAny when parsing netlink data. This makes it trivial given the address family and data buffer.
Tested: Ran throgh unit tests and builds fine in a BMC image.
Change-Id: I4ebe1dbd284f150ea03ee091cddda5a06806c01f Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
5058f57a | 30-Jan-2019 |
William A. Kennington III <wak@google.com> |
util: Add a function for converting IP bytes to strings
We need this for future work which turns netlink data into IP addresses.
Tested: Run through unit tests.
Change-Id: If078b28246509ca2ebd
util: Add a function for converting IP bytes to strings
We need this for future work which turns netlink data into IP addresses.
Tested: Run through unit tests.
Change-Id: If078b28246509ca2ebd3bf7bab652b84258df0bd Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
d27410f1 | 30-Jan-2019 |
William A. Kennington III <wak@google.com> |
util: Add a function for converting MAC addresses
We need to be able to convert a mac addresses from byte form into our typical human readable string form.
Tested: Unit tests pass.
Change-Id:
util: Add a function for converting MAC addresses
We need to be able to convert a mac addresses from byte form into our typical human readable string form.
Tested: Unit tests pass.
Change-Id: I6e68cfefd4d5962e1125c1b5229e61fce475729a Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
35297177 | 28-Nov-2018 |
Ratan Gupta <ratagupt@linux.vnet.ibm.com> |
Re-enable unit test
Unit test were broken after sd bus calls started throwing exception, In this repo we start the systemd-networkd with the use of sd bus calls, which throws exception and it was no
Re-enable unit test
Unit test were broken after sd bus calls started throwing exception, In this repo we start the systemd-networkd with the use of sd bus calls, which throws exception and it was not handled in the test case.
This commit fixes the problem by mocking the network manager which mock the functionality of function which makes the sdbus call.
Change-Id: I5b60a2117a661cffa36200415ca611b85dd2fda1 Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
show more ...
|
3a70fa24 | 20-Sep-2018 |
William A. Kennington III <wak@google.com> |
Migrate to a common timer class
This change pulls in sdeventplus and uses the timer implementation as a drop in for the currently included timer.
Tested: Unit tests still build but are not curr
Migrate to a common timer class
This change pulls in sdeventplus and uses the timer implementation as a drop in for the currently included timer.
Tested: Unit tests still build but are not currently running. Manually tested this change on a zaius machine and made sure timers went off.
Change-Id: I2808196581fc766843931403b83fead16926b0ae Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
57d9c506 | 14-Sep-2018 |
Gunnar Mills <gmills@us.ibm.com> |
clang-format: Update to match docs repo
Update the .clang-format file and run clang-format-6.0. This .clang-format matches the example one in https://github.com/openbmc/docs/blob/master/cpp-style-an
clang-format: Update to match docs repo
Update the .clang-format file and run clang-format-6.0. This .clang-format matches the example one in https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#clang-formatting
Change-Id: Ia331c9a5b040e1a3c45a0ebf1b8d776d93b05ae5 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
189d44ed | 09-Jul-2018 |
Patrick Venture <venture@google.com> |
reorder headers
Reordering all the headers to the following structure:
header file: local c cpp (including openbmc libraries)
source file: source.hpp (if applicable) local c cpp
Change-Id: Ia74a5
reorder headers
Reordering all the headers to the following structure:
header file: local c cpp (including openbmc libraries)
source file: source.hpp (if applicable) local c cpp
Change-Id: Ia74a5c761a3029819366159de3cfd40c5e4c4a2c Signed-off-by: Patrick Venture <venture@google.com>
show more ...
|
6b371a12 | 13-Mar-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: Change tmp file names to fix races
With MAKEFLAGS=-jN for N > 1 we hit race conditions in the test suite. Multiple independent tests use the same absolute path under /tmp for test case IO. Thi
test: Change tmp file names to fix races
With MAKEFLAGS=-jN for N > 1 we hit race conditions in the test suite. Multiple independent tests use the same absolute path under /tmp for test case IO. This leads to corruption across the tests manifesting as intermittent failures. Make the file-names semi-unique.
This solution is poor in that it makes no attempt at ensuring the file names are absolutely unique, but they are at least unique wither respect to the other test file names, which is an improvement.
Change-Id: I6b312093a2d9cd52261d02821566b69e874e7770 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
c5ae81e5 | 06-Mar-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test_rtnetlink: Increase interations in WithSingleInterface
We were hitting test failures caused by
EXPECT_EQ(true, isInterfaceAdded("igb5"));
at the end of the WithSingleInterface case. There
test_rtnetlink: Increase interations in WithSingleInterface
We were hitting test failures caused by
EXPECT_EQ(true, isInterfaceAdded("igb5"));
at the end of the WithSingleInterface case. There appears to be a race condition between the netlink handling and the timer expiry, so increment the number of retries for test stability.
Change-Id: I6cd2e4e95ee4d183466c73fa8a36a5580f566227 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
9628122e | 06-Mar-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test_rtnetlink: Improve exception handling by not handling them
All the test was doing was verifying that an exception hadn't occurred. The test would fail if one had, so we're better off just not d
test_rtnetlink: Improve exception handling by not handling them
All the test was doing was verifying that an exception hadn't occurred. The test would fail if one had, so we're better off just not doing the dance.
Change-Id: Iff7d9e4947e86b24f4cf99ddbac3e9c42e63f1d3 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
4aa13789 | 06-Mar-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test_rtnetlink: Force bus object to outlive TestRtNetlink lifetime
We were hitting a SEGFAULT by nullptr dereference in the WithSingleInterface test when calling sd_bus_ref() via the timer callback
test_rtnetlink: Force bus object to outlive TestRtNetlink lifetime
We were hitting a SEGFAULT by nullptr dereference in the WithSingleInterface test when calling sd_bus_ref() via the timer callback with code generated at -O2 from Ubuntu Artful's gcc-7.2.0:
Running main() from gtest_main.cc Note: Google Test filter = TestRtNetlink.WithSingleInterface [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from TestRtNetlink [ RUN ] TestRtNetlink.WithSingleInterface ASAN:DEADLYSIGNAL ================================================================= ==19427==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f8a944922ca bp 0x0fffd7e37fc2 sp 0x7ffebf1bfda8 T0) ==19427==The signal is caused by a READ memory access. ==19427==Hint: address points to the zero page. #0 0x7f8a944922c9 in sd_bus_ref (/lib/x86_64-linux-gnu/libsystemd.so.0+0x2e2c9) #1 0x7f8a93a5c616 in sdbusplus::bus::bus::bus(sd_bus*) /usr/local/include/sdbusplus/bus.hpp:340 #2 0x7f8a93a5c616 in sdbusplus::server::interface::interface::interface(sdbusplus::bus::bus&, char const*, char const*, sd_bus_vtable const*, void*) /usr/local/include/sdbusplus/server/interface.hpp:61 ... #16 0x559d611755e7 in phosphor::network::Manager::createInterfaces() ../network_manager.cpp:151 #17 0x559d61178e12 in phosphor::network::Manager::createChildObjects() ../network_manager.cpp:166 #18 0x559d611ed59b in std::function<void ()>::operator()() const /usr/include/c++/7/bits/std_function.h:706 #19 0x559d611ed59b in phosphor::network::Timer::timeoutHandler(sd_event_source*, unsigned long, void*) ../timer.cpp:72 #20 0x7f8a9448e80d (/lib/x86_64-linux-gnu/libsystemd.so.0+0x2a80d) #21 0x7f8a944903e9 in sd_event_dispatch (/lib/x86_64-linux-gnu/libsystemd.so.0+0x2c3e9) #22 0x7f8a94490566 in sd_event_run (/lib/x86_64-linux-gnu/libsystemd.so.0+0x2c566) #23 0x559d610e122e in phosphor::network::TestRtNetlink_WithSingleInterface_Test::TestBody() /tmp/openbmc-build-scripts.wUcrvx/phosphor-networkd/test/test_rtnetlink.cpp:135 ...
AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libsystemd.so.0+0x2e2c9) in sd_bus_ref ==19427==ABORTING
Move the bus storage to namespace scope alongside the Manager to avoid it getting cleaned up before the callback fires.
Change-Id: I3126d0b7b92fb6e66d82f9e32b43a52e44356884 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
c27170ab | 22-Nov-2017 |
Ratan Gupta <ratagupt@in.ibm.com> |
Reduce journal logs
Presently the code was creating the elog during reading of the values from the config parser which creates the journal log internally("Internal error Occured")
Apart from creati
Reduce journal logs
Presently the code was creating the elog during reading of the values from the config parser which creates the journal log internally("Internal error Occured")
Apart from creating elog,Code also logs into the journal more descriptive message saying which section and key was not found.
The code which catches the exception that also logs into the journal.
In the changed approach instead of throwing exception we are returning the return code as not finding a section or key in the network config file is not an error.
Change-Id: Ib89a3af6541fdf93fb5fa9a8e583d6c6ed88da79 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
show more ...
|