Skip to content

Commit

Permalink
Introducing Netalloc plugin + E2E tests (ligato#1452)
Browse files Browse the repository at this point in the history
* Linux interface plugin enhancements

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* vpp ifplugin: exclude DHCP-assigned IPs from InterfaceAddressDescriptor

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Distinguish localclient from other kvdb data sources

Signed-off-by: Milan Lenco <milenco@cisco.com>

* Fix resync of EXISTING linux interfaces.

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Netalloc plugin model and skeleton.

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Netalloc descriptor.

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Finalize Netalloc plugin.

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Enable Netalloc features in VPP ifplugin

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Prepare mock netalloc plugin for unit testing.

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Enable Netalloc features in Linux ifplugin.

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Example demonstrating netalloc plugin

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Fix netalloc documentation.

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Refactor netalloc plugin.

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Allow to use netalloc'd IP addresses in Linux ARPs

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Allow to use netalloc'd IP addresses in Linux Routes.

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Agent E2E tests

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Attempt to fix travis e2e tests.

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Fix netalloc documentation.

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Update cn-infra

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Integrate netalloc with vpp routes.

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* E2E tests: run agent in a separate process

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Fix E2E tests.

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* E2E tests: use REST API to wait for agent to initialize

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Address review comments.

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

* Add function to Linux ifidx to get interface by hostname.

Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
  • Loading branch information
Milan Lenčo authored and ondrej-fabry committed Sep 6, 2019
1 parent db302e2 commit ce301dd
Show file tree
Hide file tree
Showing 88 changed files with 5,367 additions and 725 deletions.
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ stages:
- Test
- Build
- Integration
- name: E2E
if: type IN (cron) OR (type IN (push) AND branch IN (master, dev))

jobs:
include:
Expand Down Expand Up @@ -71,6 +73,17 @@ jobs:
- make verify-binapi
- make integration-tests

- stage: E2E
env: VPP_VERSION=1904
script:
- make e2e-tests
- env: VPP_VERSION=1908
script:
- make e2e-tests
- env: VPP_VERSION=1901
script:
- make e2e-tests

notifications:
slack:
rooms:
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ integration-tests:
@echo "=> running integration tests"
VPP_IMG=$(VPP_IMG) ./tests/integration/vpp_integration.sh

e2e-tests:
@echo "=> running end-to-end tests"
VPP_IMG=$(VPP_IMG) ./tests/e2e/run_e2e.sh

# -------------------------------
# Code generation
# -------------------------------
Expand Down
89 changes: 50 additions & 39 deletions api/configurator/configurator.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions api/configurator/configurator.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ option go_package = "github.com/ligato/vpp-agent/api/configurator;configurator";

import "models/vpp/vpp.proto";
import "models/linux/linux.proto";
import "models/netalloc/netalloc.proto";

// Config groups all supported config data into single message.
message Config {
vpp.ConfigData vpp_config = 1;
linux.ConfigData linux_config = 2;
netalloc.ConfigData netalloc_config = 3;
}

// Notification groups all notification data into single message.
Expand Down
49 changes: 35 additions & 14 deletions api/models/linux/interfaces/interface.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 47 additions & 18 deletions api/models/linux/interfaces/interface.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,73 @@ message Interface {
enum Type {
UNDEFINED = 0;
VETH = 1;
TAP_TO_VPP = 2; /* TAP created by VPP to have the Linux-side further configured */
TAP_TO_VPP = 2; // TAP created by VPP to have the Linux-side further configured
LOOPBACK = 3;
EXISTING = 4;
};

string name = 1; /* Logical interface name unique across all configured interfaces (mandatory) */
Type type = 2; /* Interface type (mandatory) */
// Name is mandatory field representing logical name for the interface.
// It must be unique across all configured interfaces.
string name = 1;

// Type represents the type of interface and It must match with actual Link.
Type type = 2;

// Namespace is a reference to a Linux network namespace where the interface
// should be put into.
linux.namespace.NetNamespace namespace = 3;
string host_if_name = 4; /* Name of the interface in the host OS. If not set, the host name
is the same as the interface logical name. */

// Name of the interface in the host OS. If not set, the host name will be
// the same as the interface logical name.
string host_if_name = 4;

// Enabled controls if the interface should be UP.
bool enabled = 5;
repeated string ip_addresses = 6; /* IP addresses in the format <ipAddress>/<ipPrefix> */
string phys_address = 7; /* MAC address */
uint32 mtu = 8; /* Maximum transmission unit value */

// IPAddresses define list of IP addresses for the interface and must be
// defined in the following format: <ipAddress>/<ipPrefix>.
// Interface IP address can be also allocated via netalloc plugin and
// referenced here, see: api/models/netalloc/netalloc.proto
repeated string ip_addresses = 6;

// PhysAddress represents physical address (MAC) of the interface.
// Random address will be assigned if left empty.
string phys_address = 7;

/* MTU is the maximum transmission unit value. */
uint32 mtu = 8;

oneof link {
VethLink veth = 20; /* VETH-specific configuration */
TapLink tap = 21; /* TAP_TO_VPP-specific configuration */
// VETH-specific configuration
VethLink veth = 20;

// TAP_TO_VPP-specific configuration
TapLink tap = 21;
};
bool link_only = 9; /* Configure/Resync link only.
IP/MAC addresses are expected to be configured
externally - i.e. by a different agent
or manually via CLI. */

// Configure/Resync link only. IP/MAC addresses are expected to be configured
// externally - i.e. by a different agent or manually via CLI.
bool link_only = 9;
};

message VethLink {
string peer_if_name = 1; /* Name of the VETH peer, i.e. other end of the linux veth (mandatory for VETH) */
// Name of the VETH peer, i.e. other end of the linux veth (mandatory for VETH)
string peer_if_name = 1;

enum ChecksumOffloading {
CHKSM_OFFLOAD_DEFAULT = 0;
CHKSM_OFFLOAD_ENABLED = 1;
CHKSM_OFFLOAD_DISABLED = 2;
}
ChecksumOffloading rx_checksum_offloading = 2; /* checksum offloading - Rx side (enabled by default) */
ChecksumOffloading tx_checksum_offloading = 3; /* checksum offloading - Tx side (enabled by default) */

// Checksum offloading - Rx side (enabled by default)
ChecksumOffloading rx_checksum_offloading = 2;

// Checksum offloading - Tx side (enabled by default)
ChecksumOffloading tx_checksum_offloading = 3;
};

message TapLink {
string vpp_tap_if_name = 1; /* Logical name of the VPP TAP interface (mandatory for TAP_TO_VPP) */
// Logical name of the VPP TAP interface (mandatory for TAP_TO_VPP)
string vpp_tap_if_name = 1;
};
Loading

0 comments on commit ce301dd

Please sign in to comment.