Browse Source

Add debian-10, improved testing

master
Teran McKinney 2 years ago
parent
commit
9994735094
  1. 6
      debian-10.go
  2. 4
      main.go
  3. 9
      test.sh

6
debian-10.go

@ -15,7 +15,7 @@ dhcp
set mirror http://ftp.debian.org/debian/dists/buster/main/installer-amd64/current/images/netboot/debian-installer/amd64
kernel ${mirror}/linux console=ttyS0,115200n8 net.ifnames=0 netcfg/choose_interface=eth0 initrd=initrd.gz auto=true priority=critical hostname=debian-9 auto url={{.PRESEED}} preseed-md5={{.PRESEED_CHECKSUM}}
kernel ${mirror}/linux console=ttyS0,115200n8 net.ifnames=0 netcfg/choose_interface=eth0 initrd=initrd.gz auto=true priority=critical hostname=debian-10 auto url={{.PRESEED}} preseed-md5={{.PRESEED_CHECKSUM}}
initrd ${mirror}/initrd.gz
boot`
@ -84,7 +84,7 @@ func debian10(sshKey, burnpaste_endpoint string) (response IPXE, err error) {
return
}
tmpl, err := template.New("").Parse(debian9_preseed)
tmpl, err := template.New("").Parse(debian10_preseed)
if err != nil {
return
}
@ -105,7 +105,7 @@ func debian10(sshKey, burnpaste_endpoint string) (response IPXE, err error) {
return
}
tmpl, err = template.New("").Parse(debian9_ipxescript)
tmpl, err = template.New("").Parse(debian10_ipxescript)
if err != nil {
return
}

4
main.go

@ -13,9 +13,9 @@ func print_list(list []string) {
func usage() {
fmt.Fprintln(os.Stderr, "Usage: ipxeplease <command> [argument]")
fmt.Fprintln(os.Stderr, "Command: ipxe <operating system> <ssh key>")
fmt.Fprintln(os.Stderr, "Command: ipxe <operating system> <ssh key> <burnpaste endpoint>")
fmt.Fprintln(os.Stderr, "Command: list")
fmt.Fprintln(os.Stderr, "Command: web <port> <burnpaste endpoint> (Example: :5555 http://localhost:2323)")
fmt.Fprintln(os.Stderr, "Command: web <port> <burnpaste endpoint> (Example: :5555 http://localhost:2323/)")
os.Exit(1)
}

9
test.sh

@ -13,7 +13,7 @@ go build
strip -s ipxeplease
./ipxeplease web :5555 http://localhost:2323 &
./ipxeplease web :5555 http://localhost:2323/ &
PID=$!
cleanup() {
@ -38,6 +38,13 @@ echo '{"operating_system": "coreos-stable", "ssh_key": "ssh-rsa AAAA"}' | curl -
# shellcheck disable=SC2028
echo '{"operating_system": "coreos-stable", "ssh_key": "ssh-rsa AAAA\n"}' | curl -d@- -s --show-error --fail "http://localhost:5555"/ipxe | grep -100 'AAAA\n' && fail "SSH key newline stripping failed."
# These require burnpaste to be running.
# shellcheck disable=SC2028
echo '{"operating_system": "debian-9", "ssh_key": "ssh-rsa AAAA\n"}' | curl -d@- -s --show-error --fail "http://localhost:5555"/ipxe | grep -q 'stretch' || fail "No stretch in debian-9"
# shellcheck disable=SC2028
echo '{"operating_system": "debian-10", "ssh_key": "ssh-rsa AAAA\n"}' | curl -d@- -s --show-error --fail "http://localhost:5555"/ipxe | grep -q 'buster' || fail "No buster in debian-9"
cleanup
./ipxeplease list

Loading…
Cancel
Save