File: ipv6-tests.sh

package info (click to toggle)
radcli 1.2.11-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,768 kB
  • sloc: ansic: 6,089; sh: 767; makefile: 190; perl: 110
file content (43 lines) | stat: -rwxr-xr-x 1,099 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh

# Copyright (C) 2014 Nikos Mavrogiannopoulos
#
# License: BSD

srcdir="${srcdir:-.}"

echo "***********************************************"
echo "This test will use a radius server on localhost"
echo "and which can be executed with run-server.sh   "
echo "***********************************************"

TMPFILE=tmp$$.out

if test -z "$SERVER_IP6";then
	echo "the variable SERVER_IP6 is not defined"
	exit 77
fi

PID=$$
sed -e 's/::1/'$SERVER_IP6'/g' -e 's/servers-ipv6-temp/servers-ipv6-temp'$PID'/g' <$srcdir/radiusclient-ipv6.conf >radiusclient-temp$PID.conf
sed 's/::1/'$SERVER_IP6'/g' <$srcdir/servers-ipv6 >servers-ipv6-temp$PID

../src/radiusclient -D -f radiusclient-temp$PID.conf  User-Name=test6 Password=test >$TMPFILE
if test $? != 0;then
	cat $TMPFILE
	echo "Error in PAP IPv6 auth"
	exit 1
fi

grep "^Framed-IPv6-Prefix               = '2000:0:0:106::/64'$" $TMPFILE >/dev/null 2>&1
if test $? != 0;then
	echo "Error in data received by server (Framed-IPv6-Prefix)"
	cat $TMPFILE
	exit 1
fi

rm -f servers-temp$PID
rm -f $TMPFILE
rm -f radiusclient-temp$PID.conf

exit 0