mjru.bats 665 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env -S bats
  2. @test "run router1.intr" {
  3. run ssh router1.intr -- id
  4. [ "$status" -eq 0 ]
  5. [[ "$output" == *"uid=1000(eng)"* ]]
  6. }
  7. @test "run router2.intr" {
  8. run ssh router2.intr -- id
  9. [ "$status" -eq 0 ]
  10. [[ "$output" == *"uid=1000(eng)"* ]]
  11. }
  12. @test "run mjdev.intr" {
  13. run bash --rcfile dot_bash.d/mjru.bash -i -c 'mjdev.intr -- id'
  14. [ "$status" -eq 0 ]
  15. [[ "$output" == *"uid=0(root)"* ]]
  16. }
  17. @test "ansible hosts are equal to billing2" {
  18. run bash -c "[[ $(ansible all --list-hosts |& grep 'web[[:digit:]][[:digit:]]' | wc -l) -eq $(mjru-infa server | grep -c 'web[[:digit:]][[:digit:]]') ]]"
  19. [ "$status" -eq 0 ]
  20. }