summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--execs/iproute-build.yaml (renamed from execs/tas.yaml)0
-rw-r--r--execs/sync-clocks.yaml14
-rw-r--r--multinodes/lng03-lng04-ubuntu-18.04.yaml9
-rwxr-xr-xscripts/lava-common.sh16
-rwxr-xr-xscripts/run-ptp.sh14
5 files changed, 50 insertions, 3 deletions
diff --git a/execs/tas.yaml b/execs/iproute-build.yaml
index 3881e35..3881e35 100644
--- a/execs/tas.yaml
+++ b/execs/iproute-build.yaml
diff --git a/execs/sync-clocks.yaml b/execs/sync-clocks.yaml
new file mode 100644
index 0000000..7e7fb93
--- /dev/null
+++ b/execs/sync-clocks.yaml
@@ -0,0 +1,14 @@
+metadata:
+ name: ptp4linux clock sync
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "Sync clocks between servers using 802.1AS"
+ version: 1.0
+
+install:
+ deps:
+ - linuxptp
+
+run:
+ steps:
+ - echo "Syncing clocks"
+ - ./scripts/run-ptp.sh
diff --git a/multinodes/lng03-lng04-ubuntu-18.04.yaml b/multinodes/lng03-lng04-ubuntu-18.04.yaml
index d0f7604..cf10ae2 100644
--- a/multinodes/lng03-lng04-ubuntu-18.04.yaml
+++ b/multinodes/lng03-lng04-ubuntu-18.04.yaml
@@ -90,8 +90,13 @@ actions:
- repository: https://git.linaro.org/people/ilias.apalodimas/lava-sessions.git/
from: git
- path: execs/tas.yaml
- name: TAS-scheduler
+ path: execs/iproute-build.yaml
+ name: TAS-build-iproute
+
+ - repository: https://git.linaro.org/people/ilias.apalodimas/lava-sessions.git/
+ from: git
+ path: execs/sync-clocks.yaml
+ name: ptp-clock-sync
- repository: https://git.linaro.org/lava-team/hacking-session.git
from: git
diff --git a/scripts/lava-common.sh b/scripts/lava-common.sh
index 86c7f86..8b3eacd 100755
--- a/scripts/lava-common.sh
+++ b/scripts/lava-common.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
lava_result() {
reason=$1
@@ -8,3 +8,17 @@ lava_result() {
lava-test-case "$reason" --result "$result"
[ "$stop_session" = 'yes' ] && lava-test-raise "$reason" && exit 1
}
+
+find_vland_iface() {
+ # lv must match lava vlan name
+ lv='vlan_one'
+ pattern=$(lava-vland-names | awk -F ',' -v vlan="$lv" '$0 ~ vlan {print $2}')
+
+ iface_str=$(lava-vland-self | grep "$pattern")
+ mac=$(echo $iface_str | awk -F ',' '{print $2}')
+ for i in $(ls /sys/class/net/); do
+ new_mac=$(cat /sys/class/net/"$i"/address)
+ [ "$new_mac" == "$mac" ] && iface="$i" && break
+ done
+ echo $iface
+}
diff --git a/scripts/run-ptp.sh b/scripts/run-ptp.sh
new file mode 100755
index 0000000..ebaeed7
--- /dev/null
+++ b/scripts/run-ptp.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+. scripts/lava-common.sh
+
+# stop the default service
+systemctl stop ptp4l
+iface=$(find_vland_iface)
+
+echo "[global]" > testptp.cfg
+echo "[$iface]" >> testptp.cfg
+echo "#" >> testptp.cfg
+echo "transportSpecific 1" >> testptp.cfg
+# Run all as masters and let them select
+ptp4l -f testptp.cfg -i "$iface" -m &