diff options
author | Julien Dessaux | 2020-12-26 12:54:42 +0100 |
---|---|---|
committer | Julien Dessaux | 2020-12-26 12:54:42 +0100 |
commit | bbea9342330ff020b8e3094c849db88719915132 (patch) | |
tree | bee0f9b036947e2b03a10192d0927dfe5e0f6711 /config/test_data | |
parent | Began implementing config validation (diff) | |
download | shell-game-launcher-bbea9342330ff020b8e3094c849db88719915132.tar.gz shell-game-launcher-bbea9342330ff020b8e3094c849db88719915132.tar.bz2 shell-game-launcher-bbea9342330ff020b8e3094c849db88719915132.zip |
Continued implementing config validation
Diffstat (limited to '')
-rw-r--r-- | config/test_data/duplicate_menu.yaml | 89 | ||||
-rw-r--r-- | config/test_data/non_existant_chopts.yaml | 80 | ||||
-rw-r--r-- | config/test_data/non_existant_game.yaml | 81 | ||||
-rw-r--r-- | config/test_data/non_existant_menu.yaml | 72 | ||||
-rw-r--r-- | config/test_data/unreachable_game.yaml | 90 | ||||
-rw-r--r-- | config/test_data/unreachable_menu.yaml | 87 |
6 files changed, 499 insertions, 0 deletions
diff --git a/config/test_data/duplicate_menu.yaml b/config/test_data/duplicate_menu.yaml new file mode 100644 index 0000000..d2a00e2 --- /dev/null +++ b/config/test_data/duplicate_menu.yaml @@ -0,0 +1,89 @@ +App: + WorkingDirectory: var/ + MaxUsers: 512 + AllowRegistration: true + MaxNickLen: 15 + MenuMaxIdleTime: 600 + PostLoginCommands: + - mkdir %w/userdata/%u + - mkdir %w/userdata/%u/dumplog + - mkdir %w/userdata/%u/ttyrec + +Menus: + anonymous: + Banner: 'Shell Game Launcher - Anonymous access%n======================================' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: t + Label: test + Action: menu test + - Key: l + Label: login + Action: login + - Key: r + Label: register + Action: register + - Key: w + Label: watch + Action: watch_menu + - Key: q + Label: quit + Action: quit + logged_in: + Banner: 'Shell Game Launcher%n===================' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: p + Label: play Nethack 3.7 + Action: play nethack3.7 + - Key: o + Label: edit game options + Action: menu options + - Key: w + Label: watch + Action: watch + - Key: r + Label: replay + Action: replay + - Key: c + Label: change password + Action: passwd + - Key: m + Label: change email + Action: chmail + - Key: q + Label: quit + Action: quit + test: + Banner: 'Shell Game Launcher%n===================' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: p + Label: play Nethack 3.7 + Action: play nethack3.7 + test: + Banner: 'Duplicate Shell Game Launcher%n===================' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: p + Label: play Nethack 3.7 + Action: play nethack3.7 + +Games: + nethack3.7: + ChrootPath: /opt/nethack + FileMode: "0666" + ScoreCommands: + - exec /games/nethack -s all + - wait + Commands: + - cp /games/var/save/%u%n.gz /games/var/save/%u%n.gz.bak + - exec /games/nethack -u %n + Env: + NETHACKOPTIONS: "@%ruserdata/%n/%n.nhrc" + + diff --git a/config/test_data/non_existant_chopts.yaml b/config/test_data/non_existant_chopts.yaml new file mode 100644 index 0000000..d3ec2a5 --- /dev/null +++ b/config/test_data/non_existant_chopts.yaml @@ -0,0 +1,80 @@ +App: + WorkingDirectory: var/ + MaxUsers: 512 + AllowRegistration: true + MaxNickLen: 15 + MenuMaxIdleTime: 600 + PostLoginCommands: + - mkdir %w/userdata/%u + - mkdir %w/userdata/%u/dumplog + - mkdir %w/userdata/%u/ttyrec + +Menus: + anonymous: + Banner: 'Shell Game Launcher - Anonymous access%n======================================' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: l + Label: login + Action: login + - Key: r + Label: register + Action: register + - Key: w + Label: watch + Action: watch_menu + - Key: q + Label: quit + Action: quit + logged_in: + Banner: 'Shell Game Launcher%n===================' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: p + Label: play Nethack 3.7 + Action: play nethack3.7 + - Key: o + Label: edit game options + Action: menu options + - Key: w + Label: watch + Action: watch + - Key: r + Label: replay + Action: replay + - Key: c + Label: change password + Action: passwd + - Key: m + Label: change email + Action: chmail + - Key: q + Label: quit + Action: quit + options: + Banner: 'Options%n=======' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: a + Label: edit options for Nethack 3.7 + Action: chopts invalid + - Key: z + Label: back + Action: menu logged_in + +Games: + nethack3.7: + ChrootPath: /opt/nethack + FileMode: "0666" + ScoreCommands: + - exec /games/nethack -s all + - wait + Commands: + - cp /games/var/save/%u%n.gz /games/var/save/%u%n.gz.bak + - exec /games/nethack -u %n + Env: + NETHACKOPTIONS: "@%ruserdata/%n/%n.nhrc" + diff --git a/config/test_data/non_existant_game.yaml b/config/test_data/non_existant_game.yaml new file mode 100644 index 0000000..c386e1a --- /dev/null +++ b/config/test_data/non_existant_game.yaml @@ -0,0 +1,81 @@ +App: + WorkingDirectory: var/ + MaxUsers: 512 + AllowRegistration: true + MaxNickLen: 15 + MenuMaxIdleTime: 600 + PostLoginCommands: + - mkdir %w/userdata/%u + - mkdir %w/userdata/%u/dumplog + - mkdir %w/userdata/%u/ttyrec + +Menus: + anonymous: + Banner: 'Shell Game Launcher - Anonymous access%n======================================' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: l + Label: login + Action: login + - Key: r + Label: register + Action: register + - Key: w + Label: watch + Action: watch_menu + - Key: q + Label: quit + Action: quit + logged_in: + Banner: 'Shell Game Launcher%n===================' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: p + Label: play Nethack 3.7 + Action: play invalid + - Key: o + Label: edit game options + Action: menu options + - Key: w + Label: watch + Action: watch + - Key: r + Label: replay + Action: replay + - Key: c + Label: change password + Action: passwd + - Key: m + Label: change email + Action: chmail + - Key: q + Label: quit + Action: quit + options: + Banner: 'Options%n=======' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: a + Label: edit options for Nethack 3.7 + Action: chopts nethack3.7 + - Key: z + Label: back + Action: menu logged_in + +Games: + nethack3.7: + ChrootPath: /opt/nethack + FileMode: "0666" + ScoreCommands: + - exec /games/nethack -s all + - wait + Commands: + - cp /games/var/save/%u%n.gz /games/var/save/%u%n.gz.bak + - exec /games/nethack -u %n + Env: + NETHACKOPTIONS: "@%ruserdata/%n/%n.nhrc" + + diff --git a/config/test_data/non_existant_menu.yaml b/config/test_data/non_existant_menu.yaml new file mode 100644 index 0000000..2890ee8 --- /dev/null +++ b/config/test_data/non_existant_menu.yaml @@ -0,0 +1,72 @@ +App: + WorkingDirectory: var/ + MaxUsers: 512 + AllowRegistration: true + MaxNickLen: 15 + MenuMaxIdleTime: 600 + PostLoginCommands: + - mkdir %w/userdata/%u + - mkdir %w/userdata/%u/dumplog + - mkdir %w/userdata/%u/ttyrec + +Menus: + anonymous: + Banner: 'Shell Game Launcher - Anonymous access%n======================================' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: t + Label: test + Action: menu test + - Key: l + Label: login + Action: login + - Key: r + Label: register + Action: register + - Key: w + Label: watch + Action: watch_menu + - Key: q + Label: quit + Action: quit + logged_in: + Banner: 'Shell Game Launcher%n===================' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: p + Label: play Nethack 3.7 + Action: play nethack3.7 + - Key: o + Label: edit game options + Action: menu invalid + - Key: w + Label: watch + Action: watch + - Key: r + Label: replay + Action: replay + - Key: c + Label: change password + Action: passwd + - Key: m + Label: change email + Action: chmail + - Key: q + Label: quit + Action: quit + +Games: + nethack3.7: + ChrootPath: /opt/nethack + FileMode: "0666" + ScoreCommands: + - exec /games/nethack -s all + - wait + Commands: + - cp /games/var/save/%u%n.gz /games/var/save/%u%n.gz.bak + - exec /games/nethack -u %n + Env: + NETHACKOPTIONS: "@%ruserdata/%n/%n.nhrc" + diff --git a/config/test_data/unreachable_game.yaml b/config/test_data/unreachable_game.yaml new file mode 100644 index 0000000..a6a8977 --- /dev/null +++ b/config/test_data/unreachable_game.yaml @@ -0,0 +1,90 @@ +App: + WorkingDirectory: var/ + MaxUsers: 512 + AllowRegistration: true + MaxNickLen: 15 + MenuMaxIdleTime: 600 + PostLoginCommands: + - mkdir %w/userdata/%u + - mkdir %w/userdata/%u/dumplog + - mkdir %w/userdata/%u/ttyrec + +Menus: + anonymous: + Banner: 'Shell Game Launcher - Anonymous access%n======================================' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: l + Label: login + Action: login + - Key: r + Label: register + Action: register + - Key: w + Label: watch + Action: watch_menu + - Key: q + Label: quit + Action: quit + logged_in: + Banner: 'Shell Game Launcher%n===================' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: p + Label: play Nethack 3.7 + Action: play nethack3.7 + - Key: o + Label: edit game options + Action: menu options + - Key: w + Label: watch + Action: watch + - Key: r + Label: replay + Action: replay + - Key: c + Label: change password + Action: passwd + - Key: m + Label: change email + Action: chmail + - Key: q + Label: quit + Action: quit + options: + Banner: 'Options%n=======' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: a + Label: edit options for Nethack 3.7 + Action: chopts nethack3.7 + - Key: z + Label: back + Action: menu logged_in + +Games: + nethack3.7: + ChrootPath: /opt/nethack + FileMode: "0666" + ScoreCommands: + - exec /games/nethack -s all + - wait + Commands: + - cp /games/var/save/%u%n.gz /games/var/save/%u%n.gz.bak + - exec /games/nethack -u %n + Env: + NETHACKOPTIONS: "@%ruserdata/%n/%n.nhrc" + unreachable: + ChrootPath: /opt/nethack + FileMode: "0666" + ScoreCommands: + - exec /games/nethack -s all + - wait + Commands: + - cp /games/var/save/%u%n.gz /games/var/save/%u%n.gz.bak + - exec /games/nethack -u %n + Env: + NETHACKOPTIONS: "@%ruserdata/%n/%n.nhrc" diff --git a/config/test_data/unreachable_menu.yaml b/config/test_data/unreachable_menu.yaml new file mode 100644 index 0000000..27da191 --- /dev/null +++ b/config/test_data/unreachable_menu.yaml @@ -0,0 +1,87 @@ +App: + WorkingDirectory: var/ + MaxUsers: 512 + AllowRegistration: true + MaxNickLen: 15 + MenuMaxIdleTime: 600 + PostLoginCommands: + - mkdir %w/userdata/%u + - mkdir %w/userdata/%u/dumplog + - mkdir %w/userdata/%u/ttyrec + +Menus: + anonymous: + Banner: 'Shell Game Launcher - Anonymous access%n======================================' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: l + Label: login + Action: login + - Key: r + Label: register + Action: register + - Key: w + Label: watch + Action: watch_menu + - Key: q + Label: quit + Action: quit + logged_in: + Banner: 'Shell Game Launcher%n===================' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: p + Label: play Nethack 3.7 + Action: play nethack3.7 + - Key: o + Label: edit game options + Action: menu options + - Key: w + Label: watch + Action: watch + - Key: r + Label: replay + Action: replay + - Key: c + Label: change password + Action: passwd + - Key: m + Label: change email + Action: chmail + - Key: q + Label: quit + Action: quit + options: + Banner: 'Options%n=======' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: a + Label: edit options for Nethack 3.7 + Action: chopts nethack3.7 + - Key: z + Label: back + Action: menu logged_in + unreachable: + Banner: 'Options%n=======' + XOffset: 5 + YOffset: 2 + MenuEntries: + - Key: a + Label: edit options for Nethack 3.7 + Action: chopts nethack3.7 + +Games: + nethack3.7: + ChrootPath: /opt/nethack + FileMode: "0666" + ScoreCommands: + - exec /games/nethack -s all + - wait + Commands: + - cp /games/var/save/%u%n.gz /games/var/save/%u%n.gz.bak + - exec /games/nethack -u %n + Env: + NETHACKOPTIONS: "@%ruserdata/%n/%n.nhrc" |