Skip to content

Commit

Permalink
vagrant, test: Accept NETNEXT=1 syntax
Browse files Browse the repository at this point in the history
Document NETNEXT option for the dev. VM and accept NETNEXT=1 syntax for
consistency with other options.

Signed-off-by: Paul Chaignon <paul@cilium.io>
  • Loading branch information
pchaigno authored and Michal Rostecki committed Apr 15, 2020
1 parent 76a13f9 commit 263fbd5
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions Documentation/contributing/development/dev_setup.rst
Expand Up @@ -107,6 +107,7 @@ brought up by vagrant:
kube-proxy, kubectl and Cilium. When used in combination with ``NWORKERS=1`` a
second node is created, where ``k8s2`` will be a kubernetes node, which
contains: kubelet, kube-proxy, kubectl and cilium.
* ``NETNEXT=1``: Run with net-next kernel.
* ``IPV4=1``: Run Cilium with IPv4 enabled.
* ``RUNTIME=x``: Sets up the container runtime to be used inside a kubernetes
cluster. Valid options are: ``docker``, ``containerd`` and ``crio``. If not
Expand Down
2 changes: 1 addition & 1 deletion Documentation/contributing/testing/e2e.rst
Expand Up @@ -140,7 +140,7 @@ supported version of Kubernetes, run the test suite with the following format:

.. note::

When provisioning VMs with the net-next kernel (``NETNEXT=true``) on
When provisioning VMs with the net-next kernel (``NETNEXT=1``) on
VirtualBox which version does not match a version of the VM image
VirtualBox Guest Additions, Vagrant will install a new version of
the Additions with ``mount.vboxsf``. The latter is not compatible with
Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Expand Up @@ -10,7 +10,7 @@ $SERVER_VERSION= (ENV['SERVER_VERSION'] || $SERVER_VERSION)
$NETNEXT_SERVER_BOX = (ENV['NETNEXT_SERVER_BOX'] || $NETNEXT_SERVER_BOX)
$NETNEXT_SERVER_VERSION= (ENV['NETNEXT_SERVER_VERSION'] || $NETNEXT_SERVER_VERSION)

if ENV['NETNEXT'] == "true"
if ENV['NETNEXT'] == "true" || ENV['NETNEXT'] == "1" then
$SERVER_BOX = $NETNEXT_SERVER_BOX
$SERVER_VERSION = $NETNEXT_SERVER_VERSION
$vm_kernel = '+'
Expand Down
2 changes: 1 addition & 1 deletion jenkinsfiles/flannel.Jenkinsfile
Expand Up @@ -10,7 +10,7 @@ pipeline {
TESTDIR = "${WORKSPACE}/${PROJ_PATH}/"
VM_MEMORY = "4096"
SERVER_BOX = "cilium/ubuntu"
NETNEXT=setIfLabel("ci/net-next", "true", "false")
NETNEXT=setIfLabel("ci/net-next", "1", "0")
CNI_INTEGRATION="flannel"
GINKGO_TIMEOUT="73m"
}
Expand Down
6 changes: 3 additions & 3 deletions jenkinsfiles/ginkgo.Jenkinsfile
Expand Up @@ -9,7 +9,7 @@ pipeline {
PROJ_PATH = "src/github.com/cilium/cilium"
VM_MEMORY = "4096"
SERVER_BOX = "cilium/ubuntu"
NETNEXT=setIfLabel("ci/net-next", "true", "false")
NETNEXT=setIfLabel("ci/net-next", "1", "0")
GINKGO_TIMEOUT="300m"
}

Expand Down Expand Up @@ -147,7 +147,7 @@ pipeline {
TESTED_SUITE="k8s-1.11"
GOPATH="${WORKSPACE}/${TESTED_SUITE}-gopath"
TESTDIR="${GOPATH}/${PROJ_PATH}/test"
NETNEXT="true"
NETNEXT="1"
K8S_VERSION="1.11"
K8S_NODES="3"
NO_CILIUM_ON_NODE="k8s3"
Expand Down Expand Up @@ -246,7 +246,7 @@ pipeline {
TESTED_SUITE="k8s-1.11"
GOPATH="${WORKSPACE}/${TESTED_SUITE}-gopath"
TESTDIR="${GOPATH}/${PROJ_PATH}/test"
NETNEXT="true"
NETNEXT="1"
KUBECONFIG="${TESTDIR}/vagrant-kubeconfig"
K8S_VERSION="1.11"
K8S_NODES="3"
Expand Down
2 changes: 1 addition & 1 deletion test/Vagrantfile
Expand Up @@ -36,7 +36,7 @@ if ENV['KERNEL'] != nil && ENV['KERNEL'] != ""
$SERVER_VERSION = instance_variable_get("@v"+ ENV['KERNEL'] + "_SERVER_VERSION")
end

if ENV['NETNEXT'] == "true"
if ENV['NETNEXT'] == "true" || ENV['NETNEXT'] == "1" then
$SERVER_BOX = $NETNEXT_SERVER_BOX
$SERVER_VERSION = $NETNEXT_SERVER_VERSION
end
Expand Down
3 changes: 2 additions & 1 deletion test/helpers/utils.go
Expand Up @@ -454,7 +454,8 @@ func failIfContainsBadLogMsg(logs string, blacklist map[string][]string) {
// kernel (depending on the image, it's the latest kernel either from net-next.git
// or bpf-next.git tree), or on the > 4.19.57 kernel.
func RunsOnNetNextOr419Kernel() bool {
return os.Getenv("NETNEXT") == "true" || os.Getenv("KERNEL") == "419"
netNext := os.Getenv("NETNEXT")
return netNext == "true" || netNext == "1" || os.Getenv("KERNEL") == "419"
}

// DoesNotRunOnNetNextOr419Kernel is the complement function of
Expand Down
2 changes: 1 addition & 1 deletion test/k8sT/manifests/externalIPs/README.md
Expand Up @@ -10,7 +10,7 @@ will run with node-port feature enabled and without kube-proxy.
## Create a k8s cluster with 2 nodes *and* NFS

```bash
NETNEXT=true NFS=1 NWORKERS=1 K8S=1 ./contrib/vagrant/start.sh
NETNEXT=1 NFS=1 NWORKERS=1 K8S=1 ./contrib/vagrant/start.sh
```

the NFS is important because it makes the script to create 2 network interfaces on each VM.
Expand Down

0 comments on commit 263fbd5

Please sign in to comment.