summaryrefslogtreecommitdiff
path: root/.travis/cmake-freebsd-stage1.expect
diff options
context:
space:
mode:
authorMaxim Biro <nurupo.contributions@gmail.com>2020-03-04 23:11:38 -0500
committerMaxim Biro <nurupo.contributions@gmail.com>2020-03-10 06:16:00 -0400
commit26fd89437bc0351df01766a69b2b475467f85ac0 (patch)
treee2560b283fdb7371e50b31ddc4af4298e28b4aee /.travis/cmake-freebsd-stage1.expect
parentbd7b7fadbacbb84144ed2160109befa106623d5d (diff)
Update and fix FreeBSD setup on Travis-CI
- Bump FreeBSD to 12.1. - Simplify stage1 logic. - Re-try downloading the image from a different mirror if one fails. - Use the `expect` utility instead of dealing with screen's log file. - Re-run failed toxcore test one more time and in sequence.
Diffstat (limited to '.travis/cmake-freebsd-stage1.expect')
-rwxr-xr-x.travis/cmake-freebsd-stage1.expect41
1 files changed, 41 insertions, 0 deletions
diff --git a/.travis/cmake-freebsd-stage1.expect b/.travis/cmake-freebsd-stage1.expect
new file mode 100755
index 00000000..3269e742
--- /dev/null
+++ b/.travis/cmake-freebsd-stage1.expect
@@ -0,0 +1,41 @@
1#!/usr/bin/expect -f
2
3set timeout -1
4
5# Note: doesn't work if -nographic is used instead of -curses
6spawn qemu-system-x86_64 -curses -m 2048 -smp $env(NPROC) -net user,hostfwd=tcp::$env(SSH_PORT)-:22 -net nic "$env(IMAGE_NAME)"
7
8# Skip the boot menu
9expect "to boot or any other key to stop"
10send -- "\r"
11
12expect "login: "
13send -- "root\r"
14
15# Setup DHCP networking and paswordless ssh
16expect "root@freebsd:~ # "
17send -- "echo \"ifconfig_em0=DHCP\" >> /etc/rc.conf\r"
18expect "root@freebsd:~ # "
19send -- "echo \"Port 22\" >> /etc/ssh/sshd_config\r"
20expect "root@freebsd:~ # "
21send -- "echo \"PermitRootLogin yes\" >> /etc/ssh/sshd_config\r"
22expect "root@freebsd:~ # "
23send -- "echo \"PasswordAuthentication yes\" >> /etc/ssh/sshd_config\r"
24expect "root@freebsd:~ # "
25send -- "echo \"PermitEmptyPasswords yes\" >> /etc/ssh/sshd_config\r"
26expect "root@freebsd:~ # "
27send -- "echo \"sshd_enable=YES\" >> /etc/rc.conf\r"
28expect "root@freebsd:~ # "
29
30# Set the empty password
31send -- "passwd\r"
32expect "New Password:"
33send -- "\r"
34expect "Retype New Password:"
35send -- "\r"
36expect "root@freebsd:~ # "
37
38# Done
39send -- "poweroff\r"
40wait
41exit 0