diff options
author | davidovski <david@davidovski.xyz> | 2022-05-31 11:05:19 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-05-31 11:05:19 +0100 |
commit | 48ca75555522716f0f686dcae3dd6cf3d8ad714d (patch) | |
tree | 00c0f58550ba4661e87376f2f02c8001c69bae44 /repo/system/openrc/test-networking.sh | |
parent | 871b2b573f01c1b3176a0f65458b3d281b41c437 (diff) |
removed idea of repos
Diffstat (limited to 'repo/system/openrc/test-networking.sh')
-rw-r--r-- | repo/system/openrc/test-networking.sh | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/repo/system/openrc/test-networking.sh b/repo/system/openrc/test-networking.sh deleted file mode 100644 index 5e5f70b..0000000 --- a/repo/system/openrc/test-networking.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh - -# unit tests for find_ifaces and find_running_ifaces in networking.initd - -cfgfile=/tmp/openrc-test-network.$$ -sourcefile=$cfgfile.source -sourcedir=$cfgfile.d -ifstate=$cfgfile.state - -cat >$cfgfile<<EOF -auto eth0 -iface eth0 inet dhcp - -source $sourcefile - -source-directory $sourcedir -EOF - -cat >$sourcefile<<EOF -auto eth1 -iface eth1 inet dhcp -EOF - -mkdir -p $sourcedir -cat >$sourcedir/a<<EOF -auto eth2 -iface eth2 inet dhcp -EOF - -cat >$ifstate<<EOF -eth4=eth4 1 -EOF - -errors=0 -fail() { - echo "$@" - errors=$(( $errors + 1)) -} - -# test fallback, when ifquery does not exist -ifquery=does-not-exist -. ./networking.initd - -find_ifaces | grep -q -w eth0 || fail "Did not find eth0" -find_ifaces | grep -q -E '(eth1|eth2)' && fail "Unexpectedly found eth1 or eth2" - -# test that ifquery finds source and source-directory -unset ifquery -. ./networking.initd -for i in eth0 eth1 eth2; do - find_ifaces | grep -q -w "$i" || fail "Did not find $i" -done - -# test that ifquery picks up the running state file -find_running_ifaces | grep -q -w "eth4" || fail "Did not detect eth4 running" - - -# test /etc/init.d/net.eth5 -RC_SVCNAME=net.eth5 -. ./networking.initd -find_ifaces | grep -q -w "eth5" || fail "Did not detect eth5" -find_running_ifaces | grep -q -w "eth5" || fail "Did not detect eth5 running" - -rm -rf $cfgfile $sourcefile $sourcedir $ifstate -exit $errors |