test: add network template tests
This commit is contained in:
19
tests/network/templates/autoinstall.pkrtpl
Normal file
19
tests/network/templates/autoinstall.pkrtpl
Normal file
@@ -0,0 +1,19 @@
|
||||
network:
|
||||
network:
|
||||
version: 2
|
||||
ethernets:
|
||||
%{ if ip != null ~}
|
||||
${device}:
|
||||
dhcp4: false
|
||||
addresses:
|
||||
- ${ip}/${netmask}
|
||||
gateway4: ${gateway}
|
||||
nameservers:
|
||||
addresses:
|
||||
%{ for item in dns ~}
|
||||
- ${item}
|
||||
%{ endfor ~}
|
||||
%{ else ~}
|
||||
${device}:
|
||||
dhcp4: true
|
||||
%{ endif ~}
|
||||
5
tests/network/templates/kickstart.pkrtpl
Normal file
5
tests/network/templates/kickstart.pkrtpl
Normal file
@@ -0,0 +1,5 @@
|
||||
%{~ if ip != null ~}
|
||||
network --device=${device} --bootproto=static --ip=${ip} --netmask=${cidrnetmask("${ip}/${netmask}")} --gateway=${gateway} --nameserver=${join(",", dns)}
|
||||
%{~ else ~}
|
||||
network --device=${device} --bootproto=dhcp
|
||||
%{~ endif ~}
|
||||
9
tests/network/templates/preseed.pkrtpl
Normal file
9
tests/network/templates/preseed.pkrtpl
Normal file
@@ -0,0 +1,9 @@
|
||||
d-i netcfg/choose_interface select ${device}
|
||||
%{ if ip != null ~}
|
||||
d-i netcfg/disable_autoconfig boolean true
|
||||
d-i netcfg/get_ipaddress string ${ip}
|
||||
d-i netcfg/get_netmask string ${cidrnetmask("${ip}/${netmask}")}
|
||||
d-i netcfg/get_gateway string ${gateway}
|
||||
d-i netcfg/get_nameservers string ${join(" ", dns)}
|
||||
d-i netcfg/confirm_static boolean true
|
||||
%{ endif ~}
|
||||
Reference in New Issue
Block a user