aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/polling/polling.go12
-rw-r--r--test/integ-test/expected-results/poll-unknown.txt7
-rw-r--r--test/integ-test/expected-results/poll.txt7
3 files changed, 20 insertions, 6 deletions
diff --git a/internal/polling/polling.go b/internal/polling/polling.go
index cfd489f..7b1235b 100644
--- a/internal/polling/polling.go
+++ b/internal/polling/polling.go
@@ -42,16 +42,20 @@ const (
"#\n" +
"# Do\n" +
"# curl http://{{.baseURL}}/poll/1/06-66-de-ad-be-ef\n" +
- "# to get an idea about what iPXE will receive.\n"
+ "# to get an idea about what the iPXE client will receive.\n"
maxRetry = 10
retryScript = "#!ipxe\n" +
- "prompt --key 0x02 --timeout 10000 shoelaces: Press Ctrl-B for manual override... && " +
- "chain -ar http://{{.baseURL}}/ipxemenu || " +
- "chain -ar http://{{.baseURL}}/poll/1/{{.macAddress}}\n"
+ "prompt --key 0x02 --timeout 7000 shoelaces: Press Ctrl-B for manual override... \\\n" +
+ " && chain -ar http://{{.baseURL}}/ipxemenu \\\n" +
+ " || chain -ar http://{{.baseURL}}/poll/1/{{.macAddress}}\n\n" +
+ "# Note: the iPXE client will see the above code as an endless loop.\n" +
+ "# However, Shoelaces will break that loop after a fixed number of retries.\n"
timeoutScript = "#!ipxe\n" +
+ "echo\n" +
+ "echo Shoelaces reached the maximum number of retries\n" +
"exit\n"
// BootAction is used when a user selects a script for the polling
diff --git a/test/integ-test/expected-results/poll-unknown.txt b/test/integ-test/expected-results/poll-unknown.txt
index f17022f..0e35aa6 100644
--- a/test/integ-test/expected-results/poll-unknown.txt
+++ b/test/integ-test/expected-results/poll-unknown.txt
@@ -1,2 +1,7 @@
#!ipxe
-prompt --key 0x02 --timeout 10000 shoelaces: Press Ctrl-B for manual override... && chain -ar http://localhost:18888/ipxemenu || chain -ar http://localhost:18888/poll/1/06-66-de-ad-be-ef
+prompt --key 0x02 --timeout 7000 shoelaces: Press Ctrl-B for manual override... \
+ && chain -ar http://localhost:18888/ipxemenu \
+ || chain -ar http://localhost:18888/poll/1/06-66-de-ad-be-ef
+
+# Note: the iPXE client will see the above code as an endless loop.
+# However, Shoelaces will break that loop after a fixed number of retries.
diff --git a/test/integ-test/expected-results/poll.txt b/test/integ-test/expected-results/poll.txt
index dbba541..a941b7a 100644
--- a/test/integ-test/expected-results/poll.txt
+++ b/test/integ-test/expected-results/poll.txt
@@ -1,2 +1,7 @@
#!ipxe
-prompt --key 0x02 --timeout 10000 shoelaces: Press Ctrl-B for manual override... && chain -ar http://localhost:18888/ipxemenu || chain -ar http://localhost:18888/poll/1/ff-ff-ff-ff-ff-ff
+prompt --key 0x02 --timeout 7000 shoelaces: Press Ctrl-B for manual override... \
+ && chain -ar http://localhost:18888/ipxemenu \
+ || chain -ar http://localhost:18888/poll/1/ff-ff-ff-ff-ff-ff
+
+# Note: the iPXE client will see the above code as an endless loop.
+# However, Shoelaces will break that loop after a fixed number of retries.
nihil fit ex nihilo