| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Use system-first search for inclusion of dbus interface headers.
Change-Id: I9953ca047c09c1003c86b1ffaf929698c157139c
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Use expect_throw to catch expected exceptions in tests.
Change-Id: I410655a43328d44c5b9f95dff509c132499bcd07
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
1. Added testcases to validate IP/PrefixLengnth/MACAddress.
2. Added test to rtnetlink.
Resolves openbmc/openbmc#2546
Change-Id: I61efbf69682a50f7479b68e32d9714e9c81a32d7
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
|
|
| |
Fixes openbmc/openbmc#2107
Change-Id: Id6810be3527e4861430077364a5af4dc00e52f3b
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
This commit integrates watching for DNS entries and updating
/etc/resolv.conf functionality into network manager daemon
as opposed to having another daemon doing just that.
Change-Id: Id858815675ed4a23ee8c6a31ba3ae6e5ee0054fd
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
Added code to register for inotify events on the needed
path and the user callback on events
Change-Id: I90529f8e96fcbecfe0a1b943c3c435dab79222c3
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
Added function to write DNS entries to specified file
Also, added test case
Change-Id: I64250c7ee3cf7db3e7f8b5cf1669c7b4a7738637
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
-validates IPAddress/gateway using inet_pton api.
-validates prefix length for ipv4/ipv6.
-if dhcp is enabled, it won't allow to set ip/gateway.
Resolves openbmc/openbmc#1671
Change-Id: I76c1d9d11dfb59002eb1310d87e94ee622714a4a
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
|
|
| |
Resolves openbmc/openbmc#2106
Change-Id: I93bbbb1178dc47fa94f98719185630020e00edda
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Start the timer once we get the dbus request and wait for timeout
if we get the dbus request in meanwhile, reset the timer and
wait for timeout.
Listen for ipv6 rtnetlink address also.
Resolves openbmc/openbmc#2227
Change-Id: I3f448e84107826defafb9ada523c1ab08ec1b971
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extend the refresh timer once we get the Dbus request which
requires network restart.
Detaching the network restart from the writeConfiguration func.
Write the configuration file for the vlan interface in
writeConfiguration func.
During creation of vlan,vlan interface should come up with
dhcp as false.
Change-Id: Iadc7b44554aca412d211d13e9569cc601ad04074
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
| |
Change-Id: Ifd2507b12f39c44857af8bcf6ea57f7d1daa7ac3
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
| |
implementation of writing interface conf to the
ethernet interface class.
Change-Id: I279afff45a82ca92c4e50810664f7a7c69a66a61
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
| |
Change-Id: I118fc4bbcad2a478a8aad976e0619537780c1227
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
when the network manager comes up,it should have its
conf dir path which caller wants,instead of calling one
more function to set the desired conf dir.
Change-Id: I282c1d5e1c6edb2b6e77d16518d2204a6ac41a45
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
| |
Change-Id: I6085868ba4e30bb9e1c6f6d9895a40ebff82804f
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
As compiler was not able to pick the override
function definition.
Make works fine but make check was having problem.
Change-Id: I030b89065c2929019e36f8d30f6103289cd07344
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
This commit implements the below dhcp options
1) DNS
2) NTP
3) HostName
Change-Id: Ifb66fbc86ce38abc79454ecbbf6fb3c65f892c19
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
| |
Parse the systemd.network file
to get the configuration parameter.
Change-Id: Ic9c15a46158d2f1c0948e6eca729663e87051491
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
| |
Also put extra checks while writing the gateway
and the destination to the conf file.
Change-Id: I8f24b3f293e6f978b655f061a198a32690dd44f3
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
| |
Resolves openbmc/openbmc#1590
Change-Id: I76328e596336f8b8f1394b1927d48ce52f819a66
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
| |
eg 192.168.2.24/24 ==> 192.168.2.0
Change-Id: I5e46ce7b371360c90ef74fac175c8379c6f31d4c
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
| |
Change-Id: Ibf3a2b3513c784a56540488fa7de5a638a83a833
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
| |
Resolves openbmc/openbmc#1462
Change-Id: Ib4cb6fc52dca05c9af38fe5197d9d7dff2031af7
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
Change-Id: I75cc1c1642bd4160191853d6ebfa5427e7f534c3
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|