File: prep-testbed.sh

package info (click to toggle)
netplan.io 1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,268 kB
  • sloc: python: 34,640; ansic: 14,096; xml: 4,989; javascript: 2,165; sh: 513; makefile: 118
file content (29 lines) | stat: -rwxr-xr-x 978 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
set -xe
# stop NetworkManager, to start with a common state
if [ "$(systemctl is-active NetworkManager.service)" = active ]; then
    systemctl stop NetworkManager.service
fi

# Make sure the system is ready before starting our tests
systemctl daemon-reload

# only relevant on Debian
dpkg-vendor --is Debian || exit 0

# disable ifupdown
rm -f /etc/network/interfaces
# enable systemd-networkd
systemctl unmask systemd-networkd.service
systemctl unmask systemd-networkd.socket
systemctl unmask systemd-networkd-wait-online.service
systemctl enable systemd-networkd.service
systemctl start systemd-networkd.service
# enable systemd-resolved
systemctl unmask systemd-resolved.service || true
systemctl enable systemd-resolved.service || true
systemctl restart systemd-resolved.service || echo "WARNING: Cannot restart systemd-resolved.service"
# enable systemd-udevd
mount -o remount,rw /sys
systemctl unmask systemd-udevd.service
systemctl start systemd-udevd.service