diff options
author | Maxim Biro <nurupo.contributions@gmail.com> | 2020-03-04 23:11:38 -0500 |
---|---|---|
committer | Maxim Biro <nurupo.contributions@gmail.com> | 2020-03-10 06:16:00 -0400 |
commit | 26fd89437bc0351df01766a69b2b475467f85ac0 (patch) | |
tree | e2560b283fdb7371e50b31ddc4af4298e28b4aee /.travis/cmake-freebsd-stage1.expect | |
parent | bd7b7fadbacbb84144ed2160109befa106623d5d (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.expect | 41 |
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 | |||
3 | set timeout -1 | ||
4 | |||
5 | # Note: doesn't work if -nographic is used instead of -curses | ||
6 | spawn 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 | ||
9 | expect "to boot or any other key to stop" | ||
10 | send -- "\r" | ||
11 | |||
12 | expect "login: " | ||
13 | send -- "root\r" | ||
14 | |||
15 | # Setup DHCP networking and paswordless ssh | ||
16 | expect "root@freebsd:~ # " | ||
17 | send -- "echo \"ifconfig_em0=DHCP\" >> /etc/rc.conf\r" | ||
18 | expect "root@freebsd:~ # " | ||
19 | send -- "echo \"Port 22\" >> /etc/ssh/sshd_config\r" | ||
20 | expect "root@freebsd:~ # " | ||
21 | send -- "echo \"PermitRootLogin yes\" >> /etc/ssh/sshd_config\r" | ||
22 | expect "root@freebsd:~ # " | ||
23 | send -- "echo \"PasswordAuthentication yes\" >> /etc/ssh/sshd_config\r" | ||
24 | expect "root@freebsd:~ # " | ||
25 | send -- "echo \"PermitEmptyPasswords yes\" >> /etc/ssh/sshd_config\r" | ||
26 | expect "root@freebsd:~ # " | ||
27 | send -- "echo \"sshd_enable=YES\" >> /etc/rc.conf\r" | ||
28 | expect "root@freebsd:~ # " | ||
29 | |||
30 | # Set the empty password | ||
31 | send -- "passwd\r" | ||
32 | expect "New Password:" | ||
33 | send -- "\r" | ||
34 | expect "Retype New Password:" | ||
35 | send -- "\r" | ||
36 | expect "root@freebsd:~ # " | ||
37 | |||
38 | # Done | ||
39 | send -- "poweroff\r" | ||
40 | wait | ||
41 | exit 0 | ||