summaryrefslogtreecommitdiffstats
path: root/debian/tests/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'debian/tests/hooks')
-rwxr-xr-xdebian/tests/hooks/drop-hostname17
-rwxr-xr-xdebian/tests/hooks/persistent-net32
2 files changed, 49 insertions, 0 deletions
diff --git a/debian/tests/hooks/drop-hostname b/debian/tests/hooks/drop-hostname
new file mode 100755
index 0000000..e7b8500
--- /dev/null
+++ b/debian/tests/hooks/drop-hostname
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+PREREQ=""
+
+prereqs()
+{
+ echo "$PREREQ"
+}
+
+case "$1" in
+prereqs)
+ prereqs
+ exit 0
+ ;;
+esac
+
+rm -f "${DESTDIR}/etc/hostname"
diff --git a/debian/tests/hooks/persistent-net b/debian/tests/hooks/persistent-net
new file mode 100755
index 0000000..819109e
--- /dev/null
+++ b/debian/tests/hooks/persistent-net
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+PREREQ=""
+
+prereqs()
+{
+ echo "$PREREQ"
+}
+
+case "$1" in
+prereqs)
+ prereqs
+ exit 0
+ ;;
+esac
+
+persist_net() {
+ name="$1"
+ mac="$2"
+
+ mkdir -p "${DESTDIR}/etc/systemd/network"
+ cat >"${DESTDIR}/etc/systemd/network/10-persistent-${name}.link" <<EOF
+[Match]
+MACAddress=${mac}
+
+[Link]
+Name=${name}
+EOF
+}
+
+persist_net lan0 "52:54:00:65:43:21"
+persist_net lan1 "52:54:00:12:34:56"