Skip to content

Commit

Permalink
tests: Add terminal emulator compatibility tests.
Browse files Browse the repository at this point in the history
Add tests emulating the behavior of several different terminal
emulators using both Telnet and RLogin. Hitherto, there has
been no automated testing of terminal emulators, so this will
help protect against possible regressions in the future if/as
changes are made in pty.c and corresponding net drivers.
  • Loading branch information
InterLinked1 committed Sep 27, 2024
1 parent 5d62341 commit 7388c83
Show file tree
Hide file tree
Showing 5 changed files with 417 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/menus.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title = Main Menu
q = quit|Logoff
a = menu:a|Menu A1
b = menu:b|Menu B
u = menu:u|Menu U

[a]
title = Menu A1
Expand All @@ -16,3 +17,8 @@ q = return|Back
[b]
title = Menu B
q = return|Back

[u]
title = Menu U
a = return|Test Token
q = return|Back
3 changes: 3 additions & 0 deletions tests/net_telnet.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[telnet]
port = 23
ttyport = 2245
1 change: 1 addition & 0 deletions tests/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ static int run_test(const char *filename, int multiple)
fprintf(modulefp, "[users]\r\n%s=%s\r\n", TEST_USER, TEST_HASH);
fprintf(modulefp, "%s=%s\r\n", TEST_USER2, TEST_HASH2);
fprintf(modulefp, "%s=%s\r\n", TEST_USER3, TEST_HASH3);
fprintf(modulefp, "%s=%s\r\n", TEST_USER4, TEST_HASH4);
fclose(modulefp);
}
if (option_autoload_all) {
Expand Down
4 changes: 4 additions & 0 deletions tests/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ struct test_module *TEST_MODULE_SELF_SYM(void);
#define TEST_HASH3 "$2y$10$0hcFFDyIUBkNcqMPw9G0t.vR.c8oBArJJOE1tK1atcPWkk9XBhvzK"
#define TEST_SASL3 "dGVzdHVzZXIyAHRlc3R1c2VyMgBQQHNzdzByRA=="

#define TEST_USER4 "termtest"
#define TEST_PASS4 "TERMPASS"
#define TEST_HASH4 "$2y$10$aa80TI0jN6Dqq3G5ctBKruBFwL6iYCCPNJ6vV7TjZ.xN1enqPrODq"

#define ENDL "\r\n"

int test_dir_file_count(const char *directory);
Expand Down
Loading

0 comments on commit 7388c83

Please sign in to comment.