Skip to content

Commit 0d635a1

Browse files
committed
Test dell with whitespace
1 parent 22d8d2c commit 0d635a1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pixiecore/http.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ func ipxeScript(mach Machine, spec *Spec, serverHost string) ([]byte, error) {
197197
var b bytes.Buffer
198198
b.WriteString("#!ipxe\n")
199199
b.WriteString("set console ttyS1\n")
200-
b.WriteString("iseq ${manufacturer} :Dell\\ Inc. && set console ttyS0 ||\n")
200+
b.WriteString("set sp:hex 20 && set sp ${sp:string}\n")
201+
b.WriteString("iseq ${manufacturer} Dell${sp}Inc. && set console ttyS0 ||\n")
201202
u := fmt.Sprintf(urlTemplate, url.QueryEscape(string(spec.Kernel)), "kernel", url.QueryEscape(mach.MAC.String()))
202203
fmt.Fprintf(&b, "kernel --name kernel %s\n", u)
203204
for i, initrd := range spec.Initrd {

pixiecore/http_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ func TestIpxe(t *testing.T) {
6767

6868
expected := `#!ipxe
6969
set console ttyS1
70-
iseq ${manufacturer} :Dell\ Inc. && set console ttyS0 ||
70+
set sp:hex 20 && set sp ${sp:string}
71+
iseq ${manufacturer} Dell${sp}Inc. && set console ttyS0 ||
7172
kernel --name kernel http://localhost:1234/_/file?name=k-01%3A02%3A03%3A04%3A05%3A06-0&type=kernel&mac=01%3A02%3A03%3A04%3A05%3A06
7273
initrd --name initrd0 http://localhost:1234/_/file?name=i1-01%3A02%3A03%3A04%3A05%3A06-0&type=initrd&mac=01%3A02%3A03%3A04%3A05%3A06
7374
initrd --name initrd1 http://localhost:1234/_/file?name=i2-01%3A02%3A03%3A04%3A05%3A06-0&type=initrd&mac=01%3A02%3A03%3A04%3A05%3A06
@@ -94,7 +95,8 @@ boot kernel initrd=initrd0 initrd=initrd1 console=${console},115200n8 thing=http
9495

9596
expected = `#!ipxe
9697
set console ttyS1
97-
iseq ${manufacturer} :Dell\ Inc. && set console ttyS0 ||
98+
set sp:hex 20 && set sp ${sp:string}
99+
iseq ${manufacturer} Dell${sp}Inc. && set console ttyS0 ||
98100
kernel --name kernel http://localhost:1234/_/file?name=k-fe%3Afe%3Afe%3Afe%3Afe%3Afe-1&type=kernel&mac=fe%3Afe%3Afe%3Afe%3Afe%3Afe
99101
initrd --name initrd0 http://localhost:1234/_/file?name=i1-fe%3Afe%3Afe%3Afe%3Afe%3Afe-1&type=initrd&mac=fe%3Afe%3Afe%3Afe%3Afe%3Afe
100102
initrd --name initrd1 http://localhost:1234/_/file?name=i2-fe%3Afe%3Afe%3Afe%3Afe%3Afe-1&type=initrd&mac=fe%3Afe%3Afe%3Afe%3Afe%3Afe

0 commit comments

Comments
 (0)