Last active
May 4, 2018 10:25
-
-
Save skx/9693551168649298d38a23482ac1f44a to your computer and use it in GitHub Desktop.
m4 for overseer test definitions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/m4 | |
# Define a macro for a tinc-protocol test | |
define(`tinc', `$1 must run tcp with port 655 with banner "^0 \S+ 17$"') | |
# builder.steve.org.uk | |
tinc(`176.9.183.97') | |
# master.steve.org.uk | |
tinc(`176.9.183.98') | |
# git.steve.org.uk | |
tinc(`176.9.183.99') | |
# www.steve.fi | |
tinc(`176.9.183.100') | |
# blogspam.net | |
tinc(`176.9.183.101') | |
# mail.steve.org.uk | |
tinc(`176.9.183.102') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./generate.sh | |
#!/usr/bin/m4 | |
# Define a macro for a tinc-protocol test | |
# builder.steve.org.uk | |
176.9.183.97 must run tcp with port 655 with banner "^0 \S+ 17$" | |
# master.steve.org.uk | |
176.9.183.98 must run tcp with port 655 with banner "^0 \S+ 17$" | |
# git.steve.org.uk | |
176.9.183.99 must run tcp with port 655 with banner "^0 \S+ 17$" | |
# www.steve.fi | |
176.9.183.100 must run tcp with port 655 with banner "^0 \S+ 17$" | |
# blogspam.net | |
176.9.183.101 must run tcp with port 655 with banner "^0 \S+ 17$" | |
# mail.steve.org.uk | |
176.9.183.102 must run tcp with port 655 with banner "^0 \S+ 17$" | |
frodo ~ $ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wrote a protocol-tester overseer, which lets you run tests on hosts/services.
It is natural to want to write macros, but I didn't want to add support to the parser. Instead if an input file is executable then the output of executing it is parsed, rather than just the literal contents, which allows local macros to be built/used.