1010Define language independent tests for your command line scripts and programs in simple ` yaml ` files.
1111
1212 - It runs on ` windows ` , ` osx ` and ` linux `
13+ - It can validate local machines, ssh hosts and docker containers
1314 - It is a self-contained binary - no need to install a heavy lib or language
1415 - It is easy and fast to write
1516
@@ -47,6 +48,10 @@ For more information take a look at the [quick start](#quick-start), the [exampl
4748 - [ interval] ( #interval )
4849 - [ retries] ( #retries )
4950 - [ timeout] ( #timeout )
51+ - [ nodes] ( #nodes )
52+ + [ Nodes] ( #nodes )
53+ - [ local] ( #local )
54+ - [ ssh] ( #ssh )
5055 + [ Development] ( #development )
5156* [ Misc] ( #misc )
5257
@@ -625,6 +630,82 @@ If a tests exceeds the given `timeout` the test will fail.
625630timeout: 600s
626631` ` `
627632
633+ # ## Nodes
634+
635+ ` Commander` has the option to execute tests against other hosts, i.e. via ssh.
636+
637+ Available node types are currently :
638+
639+ - ` local` , execute tests locally
640+ - ` ssh` , execute tests viá ssh
641+
642+ ` ` ` yaml
643+ nodes: # define nodes in the node section
644+ ssh-host:
645+ type: ssh # define the type of the connection
646+ user: root # set the user which is used by the connection
647+ pass: password # set password for authentication
648+ addr: 192.168.0.100:2222 # target host address
649+ identity-file: ~/.ssh/id_rsa # auth with private key
650+ tests:
651+ echo hello:
652+ config:
653+ nodes: # define on which host the test should be executed
654+ - ssh-host
655+ stdout: hello
656+ exit-code: 0
657+ ` ` `
658+
659+ You can identify on which node a test failed by inspecting the test output.
660+ The `[local]` and `[ssh-host]` represent the node name on which the test were executed.
661+
662+ ```
663+ ✗ [ local] it should test ssh host
664+ ✗ [ ssh-host] it should fail if env could not be set
665+ ```
666+
667+ #### local
668+
669+ The `local` node is the default execution and will be applied if nothing else was configured.
670+ It is always pre-configured and available, i.e. if you want to execute tests on a node and locally.
671+
672+ ```yaml
673+ nodes:
674+ ssh-host:
675+ addr: 192.168.1.100
676+ user: ...
677+ tests:
678+ echo hello:
679+ config:
680+ nodes: # will be executed on local and ssh-host
681+ - ssh-host
682+ - local
683+ exit-code: 0
684+ ```
685+
686+ #### ssh
687+
688+ The ` ssh ` will execute tests against a configured node using ssh.
689+
690+ ** Limitations:** The ` inhereit-env ` config is disabled for ssh hosts, nevertheless it is possible to set env variables
691+
692+ ``` yaml
693+ nodes : # define nodes in the node section
694+ ssh-host :
695+ type : ssh # define the type of the connection
696+ user : root # set the user which is used by the connection
697+ pass : password # set password for authentication
698+ addr : 192.168.0.100:2222 # target host address
699+ identity-file : ~/.ssh/id_rsa # auth with private key
700+ tests :
701+ echo hello :
702+ config :
703+ nodes : # define on which host the test should be executed
704+ - ssh-host
705+ stdout : hello
706+ exit-code : 0
707+ ` ` `
708+
628709### Development
629710
630711` ` `
@@ -640,6 +721,9 @@ $ make test
640721# Coverage
641722$ make test-coverage
642723
724+ # Coverage with more complex tests like ssh execution
725+ $ make test-coverage-all
726+
643727# Integration tests
644728$ make integration
645729
0 commit comments