summaryrefslogtreecommitdiff
path: root/setup-interfaces.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-07-01 16:11:46 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-07-01 16:12:47 +0200
commit44f820037729e03ab2c9b4f2d68bad0d943b610a (patch)
treeda868db5cd8d968cfc04f4afcc2ae4e227ae0ee4 /setup-interfaces.in
parent9a0d9de7b5acb449548462d6821175747c941526 (diff)
downloadalpine-conf-44f820037729e03ab2c9b4f2d68bad0d943b610a.zip
setup-interfaces: use fake /sys/class/net for testing
this fixes the tests so we dont mix with the hosts network interfaces.
Diffstat (limited to 'setup-interfaces.in')
-rw-r--r--setup-interfaces.in8
1 files changed, 4 insertions, 4 deletions
diff --git a/setup-interfaces.in b/setup-interfaces.in
index abe1412..3ebb320 100644
--- a/setup-interfaces.in
+++ b/setup-interfaces.in
@@ -50,7 +50,7 @@ unconfigured_isin() {
}
iface_exists() {
- test -e /sys/class/net/$1
+ test -e "$ROOT"/sys/class/net/$1
}
get_default_addr() {
@@ -114,7 +114,7 @@ is_bridge() {
}
is_wifi() {
- test -d /sys/class/net/$1/phy80211
+ test -d "$ROOT"/sys/class/net/$1/phy80211
}
find_essids() {
@@ -295,7 +295,7 @@ config_iface() {
}
is_bridge() {
- [ -e /sys/class/net/$1/bridge ] || [ -e $1.bridge_ports ]
+ [ -e "$ROOT"/sys/class/net/$1/bridge ] || [ -e $1.bridge_ports ]
}
is_bond_master() {
@@ -540,7 +540,7 @@ prompt_for_interfaces() {
auto_setup() {
local iface
for iface in $(available_ifaces); do
- if [ "$(cat /sys/class/net/$iface/operstate)" = "up" ]; then
+ if [ "$(cat "$ROOT"/sys/class/net/$iface/operstate)" = "up" ]; then
break
fi
done