tests_post-install_1bouncers.sh 832 B

123456789101112131415161718192021222324252627
  1. #! /usr/bin/env bash
  2. # -*- coding: utf-8 -*-
  3. source tests_base.sh
  4. ## bouncers
  5. # we should have 0 bouncers
  6. ${CSCLI} bouncers list -ojson | ${JQ} '. | length == 0' || fail "expected 0 bouncers"
  7. # we can add one bouncer - should we save token for later ?
  8. ${CSCLI} bouncers add ciTestBouncer || fail "failed to add bouncer"
  9. # but we can't add it twice - we would get an error
  10. ${CSCLI} bouncers add ciTestBouncer -ojson 2>&1 | ${JQ} '.level == "error"' || fail "didn't receive the expected error"
  11. # we should have 1 bouncer
  12. ${CSCLI} bouncers list -ojson | ${JQ} '. | length == 1' || fail "expected 1 bouncers"
  13. # delete the bouncer :)
  14. ${CSCLI} bouncers delete ciTestBouncer || fail "failed to delete bouncer"
  15. # we should have 0 bouncers
  16. ${CSCLI} bouncers list -ojson | ${JQ} '. | length == 0' || fail "expected 0 bouncers"