aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-04-22 12:31:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-04-22 12:31:23 +0200
commit1fc77270c6af777adb80e1df917da7dc36c75d14 (patch)
tree538e7b4498fa3c1c77beb4714d3f0690dab0650f
parent04318680fb6c36aca0ec8029d94dab0e960ac69a (diff)
Various tweaks
-rw-r--r--bbot/agent.cxx6
-rw-r--r--bbot/tftp.cxx2
-rwxr-xr-xetc/bootstrap/bbot-bootstrap-macos.sh9
-rw-r--r--etc/bootstrap/bbot-bootstrap-msvc.bat2
-rwxr-xr-xetc/bootstrap/bbot-bootstrap.sh10
-rw-r--r--tests/machine/testscript6
6 files changed, 30 insertions, 5 deletions
diff --git a/bbot/agent.cxx b/bbot/agent.cxx
index 383653a..432e53a 100644
--- a/bbot/agent.cxx
+++ b/bbot/agent.cxx
@@ -167,16 +167,16 @@ bootstrap_machine (const dir_path& md,
return nullopt;
};
- // The first request should be the toolchain download. Wait for up to 3
+ // The first request should be the toolchain download. Wait for up to 5
// minutes for that to arrive. In a sense we use it as an indication
// that the machine has booted and the bootstrap process has started.
// Why wait so long you may wonder? Well, we may be using a new MAC
// address and operating systems like Windows may need to digest that.
//
size_t to;
- const size_t startup_to (3 * 60);
+ const size_t startup_to (5 * 60);
const size_t bootstrap_to (ops.bootstrap_timeout ());
- const size_t shutdown_to (3 * 60);
+ const size_t shutdown_to (5 * 60);
if (!tftpd.serve ((to = startup_to)))
return soft_fail ("bootstrap startup timeout");
diff --git a/bbot/tftp.cxx b/bbot/tftp.cxx
index a8bb11b..3304356 100644
--- a/bbot/tftp.cxx
+++ b/bbot/tftp.cxx
@@ -122,6 +122,8 @@ namespace bbot
"--secure", // Chroot to data directory.
ops.tftp ());
+ // @@ This is not really accurate.
+ //
sec = static_cast<size_t> (timeout.tv_sec);
return true;
}
diff --git a/etc/bootstrap/bbot-bootstrap-macos.sh b/etc/bootstrap/bbot-bootstrap-macos.sh
new file mode 100755
index 0000000..e0a8ac7
--- /dev/null
+++ b/etc/bootstrap/bbot-bootstrap-macos.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# open -a Terminal -n -F ~/bbot-bootstrap-macos.sh
+
+if ~/bbot-bootstrap.sh --cxx clang++ --build /tmp \
+ --environment "$HOME/environment"; then
+ sleep 2
+ sudo shutdown -h now
+fi
diff --git a/etc/bootstrap/bbot-bootstrap-msvc.bat b/etc/bootstrap/bbot-bootstrap-msvc.bat
index de8b297..4b60f5d 100644
--- a/etc/bootstrap/bbot-bootstrap-msvc.bat
+++ b/etc/bootstrap/bbot-bootstrap-msvc.bat
@@ -66,7 +66,7 @@ cd %BUILD%\bootstrap
@rem forever.
@rem
:restart
-curl -s -S -O --connect-timeout 5 --max-time 30^
+curl -s -S -O --connect-timeout 5 --max-time 60^
"tftp://%tftp%/build2-baseutils-x86_64-windows.zip"
@if errorlevel 1 goto restart
diff --git a/etc/bootstrap/bbot-bootstrap.sh b/etc/bootstrap/bbot-bootstrap.sh
index 65deddc..9473abe 100755
--- a/etc/bootstrap/bbot-bootstrap.sh
+++ b/etc/bootstrap/bbot-bootstrap.sh
@@ -100,7 +100,15 @@ run rm -rf "$build/bootstrap"
run mkdir -p "$build/bootstrap"
run cd "$build/bootstrap"
-run curl -s -S -O "tftp://$tftp/build2-toolchain.tar.xz"
+# We could be running on a new network which may take some time to setup.
+# And if we start before that happens, we will be hanging forever.
+#
+while true; do
+ diag "+ curl -s -S -O --connect-timeout 5 --max-time 60 tftp://$tftp/build2-toolchain.tar.xz"
+ if curl -s -S -O --connect-timeout 5 --max-time 60 "tftp://$tftp/build2-toolchain.tar.xz"; then
+ break
+ fi
+done
run tar -xf build2-toolchain.tar.xz
run rm build2-toolchain.tar.xz
diff --git a/tests/machine/testscript b/tests/machine/testscript
index 238ca91..93791e9 100644
--- a/tests/machine/testscript
+++ b/tests/machine/testscript
@@ -2,6 +2,12 @@
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license : TBC; see accompanying LICENSE file
+# Note that if interrupted (^C) during machine execution, then have to
+# delete iptables rules manually. To list, use -S, to delete -D:
+#
+# iptables -t nat -S
+# iptables -S
+
test.options = --cpu 8 --ram 10485760 --verbose 3
tftp = /build/tftp