File: run

package info (click to toggle)
resolvconf-admin 0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 128 kB
  • sloc: ansic: 337; sh: 41; makefile: 35
file content (41 lines) | stat: -rwxr-xr-x 900 bytes parent folder | download
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
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh

# Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net>

set -e
set -x

NETIF=$(tests/getifname)

cleanup() {
    rm -f tests/dummy-resolvconf2
}

trap cleanup EXIT

# TODO: fill in the tests here!
./resolvconf-admin-test add "$NETIF" 4.2.2.1

[ "$(grep '^[^#]' < tests/resolv.conf)" = "nameserver 4.2.2.1" ]

./resolvconf-admin-test add "$NETIF" 4.2.2.2 4.2.2.1

[ "$(grep '^[^#]' < tests/resolv.conf)" = "$(printf "nameserver 4.2.2.2\nnameserver 4.2.2.1")" ]

ln -s dummy-resolvconf tests/dummy-resolvconf2

./resolvconf-admin-test add "$NETIF" 8.8.8.8

[ "$(grep '^[^#]' < tests/resolv.conf)" = "nameserver 8.8.8.8" ]

./resolvconf-admin-test add "$NETIF" 1.2.3.4 5.6.7.8

[ "$(grep '^[^#]' < tests/resolv.conf)" = "$(printf "nameserver 1.2.3.4\nnameserver 5.6.7.8")" ]


# TODO: test with non-existent interface


# TODO: test with DOMAIN and SEARCH

# TODO: test "resolvconf-admin del"