mirror of
https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git
synced 2026-06-21 00:07:16 +03:00
nocloud: add static IPv6 network-config support
This commit is contained in:
parent
dfe114dbed
commit
727963829e
@ -96,6 +96,7 @@ set_network_config_v2() {
|
||||
"iface $target_name" \
|
||||
"$address" >> "$ETC/network/interfaces"
|
||||
gateway="$(get_network_config ethernets/$iface/gateway4)"
|
||||
[ -n "$gateway" ] || gateway="$(get_network_config ethernets/$iface/gateway6)"
|
||||
if [ -n "$gateway" ]; then
|
||||
printf "\tgateway %s\n" "$gateway" >> "$ETC/network/interfaces"
|
||||
fi
|
||||
|
||||
@ -15,6 +15,7 @@ init_tests \
|
||||
set_network_config_v2_match_macaddress_set_name_dhcp4 \
|
||||
set_network_config_v2_configures_macifrename_service \
|
||||
set_network_config_v2_static_ipv4 \
|
||||
set_network_config_v2_static_ipv6 \
|
||||
set_network_config_auto \
|
||||
userdata_user_name \
|
||||
userdata_user_homedir \
|
||||
@ -215,6 +216,41 @@ set_network_config_v2_static_ipv4_body() {
|
||||
cat etc/resolv.conf
|
||||
}
|
||||
|
||||
set_network_config_v2_static_ipv6_body() {
|
||||
fake_network_config_nocloud <<-EOF
|
||||
version: 2
|
||||
ethernets:
|
||||
net0:
|
||||
match:
|
||||
macaddress: 52:55:55:1d:2a:0b
|
||||
set-name: lima0
|
||||
addresses:
|
||||
- 2001:db8::10/64
|
||||
gateway6: 2001:db8::1
|
||||
nameservers:
|
||||
addresses:
|
||||
- 2001:4860:4860::8888
|
||||
- 2001:4860:4860::8844
|
||||
EOF
|
||||
|
||||
atf_check \
|
||||
-o ignore \
|
||||
-e match:"set_network_interfaces: done" \
|
||||
tiny-cloud boot
|
||||
|
||||
atf_check \
|
||||
-o match:"auto lima0" \
|
||||
-o match:"iface lima0" \
|
||||
-o match:"address 2001:db8::10/64" \
|
||||
-o match:"gateway 2001:db8::1" \
|
||||
cat etc/network/interfaces
|
||||
|
||||
atf_check \
|
||||
-o match:"^nameserver 2001:4860:4860::8888$" \
|
||||
-o match:"^nameserver 2001:4860:4860::8844$" \
|
||||
cat etc/resolv.conf
|
||||
}
|
||||
|
||||
set_network_config_auto_body() {
|
||||
fake_metadata_nocloud <<-EOF
|
||||
resolv_conf:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user