File: integration-ipv6.sh

package info (click to toggle)
rootlesskit 2.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 636 kB
  • sloc: sh: 433; makefile: 25
file content (25 lines) | stat: -rwxr-xr-x 566 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
#!/bin/bash
source $(realpath $(dirname $0))/common.inc.sh
set -x

parent_ipv6="fdaa:aaaa:aaaa::1"
parent_dummy="dummy42"

sudo ip link add ${parent_dummy} type dummy
sudo ip link set dev ${parent_dummy} up
sudo ip addr add "${parent_ipv6}/64" dev ${parent_dummy}

tmp=$(mktemp -d)
echo "hello ipv6" >${tmp}/index.html

busybox httpd -f -p "[${parent_ipv6}]:8080" -h "${tmp}" &
pid=$!

$ROOTLESSKIT \
	--net=slirp4netns \
	--ipv6 \
	sh -euc "sleep 3; exec curl -fsSL http://[${parent_ipv6}]:8080"

kill -9 $pid || true
sudo ip link del ${parent_dummy}
rm -rf ${tmp}