commander-cli/commander

View on GitHub
integration/linux/nodes.yaml

Summary

Maintainability
Test Coverage
nodes:
  ssh-host:
    type: ssh
    user: root
    identity-file: integration/containers/ssh/id_rsa
    addr: 172.28.0.2:22

  ssh-host-default:
    type: ssh
    user: root
    identity-file: integration/containers/ssh/id_rsa
    addr: 172.28.0.2:22

config:
  nodes:
    - ssh-host-default

tests:
  it should test ssh host:
    command: cat /root/int-test && whoami && pwd
    config:
      nodes:
        - ssh-host
    stdout:
      contains:
        - test file ssh
        - root
        - /root
    exit-code: 0

  it should set env variable:
    config:
      nodes:
        - ssh-host
      env:
        LC_TEST_ENV: env var
    command: echo $LC_TEST_ENV
    stdout: env var

  it should be executed on ssh-host-default:
    command: whoami
    stdout: root
  
  it should skip:
    command: whoami
    stdout: root
    config:
      nodes:
      - ssh-host-default
      - ssh-host
      - local
    skip: true

  it should test multiple hosts:
    command: echo hello
    stdout: hello
    config:
      nodes:
      - ssh-host-default
      - ssh-host
      - local