summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlias Apalodimas <ilias.apalodimas@linaro.org>2018-10-25 13:26:37 +0300
committerIlias Apalodimas <ilias.apalodimas@linaro.org>2018-10-25 13:26:37 +0300
commitb6bdc737a332cbe9e90b3c641de8abf43209838c (patch)
treea689979bf4beb866550b9d29381f6c61ca711920
parent8a26ec281de257b2acb4221bae0d07c8af4e7522 (diff)
configure network interfaces of hosts
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rw-r--r--execs/conf-net.yaml10
-rw-r--r--multinodes/lng03-lng04-ubuntu-18.04.yaml5
-rwxr-xr-xscripts/conf-net.sh14
3 files changed, 29 insertions, 0 deletions
diff --git a/execs/conf-net.yaml b/execs/conf-net.yaml
new file mode 100644
index 0000000..604e451
--- /dev/null
+++ b/execs/conf-net.yaml
@@ -0,0 +1,10 @@
+metadata:
+ name: conf-net
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "Configure networking on host"
+ version: 1.0
+
+run:
+ steps:
+ - echo "Configure networking on host"
+ - ./scripts/conf-net.sh
diff --git a/multinodes/lng03-lng04-ubuntu-18.04.yaml b/multinodes/lng03-lng04-ubuntu-18.04.yaml
index b8622a0..346da91 100644
--- a/multinodes/lng03-lng04-ubuntu-18.04.yaml
+++ b/multinodes/lng03-lng04-ubuntu-18.04.yaml
@@ -92,6 +92,11 @@ actions:
from: git
path: execs/iproute-build.yaml
name: taprio-build-iproute
+
+ - repository: https://git.linaro.org/people/ilias.apalodimas/lava-sessions.git/
+ from: git
+ path: execs/conf-net.yaml
+ name: configure-network
- repository: https://git.linaro.org/people/ilias.apalodimas/lava-sessions.git/
from: git
diff --git a/scripts/conf-net.sh b/scripts/conf-net.sh
new file mode 100755
index 0000000..e7589a4
--- /dev/null
+++ b/scripts/conf-net.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+. scripts/lava-common.sh
+# set hostname
+hostname $(lava-role)
+
+iface=$(find_vland_iface)
+
+# configure an ip
+# 200 hosts should be enough
+last=$(lava-self)
+last=$(((last % 200) + 1))
+ip='192.168.200.'"$last/24"
+ip addr add dev "$iface" "$ip"