Skip to content

Commit b3a3858

Browse files
beadonclaude
andcommitted
test(integration): add Suite 13 — config mutations (options 7, 8, 9), 100 tests passing
Tests restore server.conf from backup (option 7, no restart), IPv6 toggle cancel path (option 8), performance config cancel and set bandwidth (option 9). Tighten Suite 9 start/stop timeouts from 20s to 8s — verified clean start/stop completes in under 5s on test hardware (Raspberry Pi 3). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent bb84dd8 commit b3a3858

1 file changed

Lines changed: 44 additions & 3 deletions

File tree

tests/integration_test.sh

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ it "option s → 1 starts OpenVPN server"
450450
select_option "s"
451451
expect_send "Select action" "1" 5
452452
# start runs /etc/init.d/openvpn start + sleep 2 — wait for status line then gate
453-
wait_for "Server started\|already running" 20
453+
wait_for "Server started\|already running" 8
454454
check wait_for "Press Enter" 5
455455
send ""
456456
check wait_for "Select an option:" 5
@@ -472,9 +472,9 @@ fi
472472
it "option s → 2 stops OpenVPN server"
473473
select_option "s"
474474
expect_send "Select action" "2" 5
475-
expect_send "Stop OpenVPN server" "yes" 10
475+
expect_send "Stop OpenVPN server" "yes" 5
476476
# stop runs /etc/init.d/openvpn stop + sleep 2 — wait for status line then gate
477-
wait_for "Server stopped\|stopped successfully\|already stopped" 20
477+
wait_for "Server stopped\|stopped successfully\|already stopped" 8
478478
check wait_for "Press Enter" 5
479479
send ""
480480
check wait_for "Select an option:" 5
@@ -628,6 +628,47 @@ select_option "4"
628628
wait_for "Detected WAN IP\|Detected DDNS" 20
629629
check wait_for "Select an option:" 20
630630

631+
# ── Suite 13: Config Mutations (options 7, 8, 9) ─────────────────────────────
632+
# option 7 — restore server.conf from backup (backup created by Suite 2 option 5)
633+
# option 8 — toggle IPv6 (default disabled; answer 'no' to keep disabled)
634+
# option 9 — configure performance: cancel, then set bandwidth limit
635+
# option 7 has no Press Enter gate — returns directly to menu.
636+
637+
printf "\n--- [%s] Suite 13: Config Mutations (options 7, 8, 9) ---\n" "$(ts)"
638+
639+
it "option 7 restores server.conf from backup (no restart)"
640+
select_option "7"
641+
expect_send "Backup found.*Continue\|Continue" "yes" 5
642+
wait_for "Configuration restored" 5
643+
expect_send "Restart OpenVPN" "n" 5
644+
check wait_for "Select an option:" 5
645+
646+
it "server.conf still exists after restore"
647+
check assert_file_exists "$OVPN_CONF"
648+
649+
it "option 8 shows IPv6 status and cancels when answered 'no'"
650+
select_option "8"
651+
wait_for "IPv6 Configuration" 5
652+
wait_for "currently DISABLED\|currently ENABLED" 5
653+
expect_send "Enable IPv6\|Select option" "no" 5
654+
expect_send "Press Enter" "" 5
655+
check wait_for "Select an option:" 5
656+
657+
it "option 9 → 2 cancels performance config"
658+
select_option "9"
659+
expect_send "Select option" "2" 5
660+
wait_for "Cancelled" 5
661+
expect_send "Press Enter" "" 5
662+
check wait_for "Select an option:" 5
663+
664+
it "option 9 → 1 sets bandwidth limit"
665+
select_option "9"
666+
expect_send "Select option" "1" 5
667+
expect_send "Enter bandwidth limit" "1000000" 5
668+
wait_for "Bandwidth limit set to" 5
669+
expect_send "Press Enter" "" 5
670+
check wait_for "Select an option:" 5
671+
631672
# ── Done ──────────────────────────────────────────────────────────────────────
632673

633674
quit_script

0 commit comments

Comments
 (0)