bitbucket.org/Aishee/synsec@v0.0.0-20210414005726-236fc01a153d/scripts/func_tests/tests_post-install_1bouncers.sh (about)

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