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

     1  #! /usr/bin/env bash
     2  # -*- coding: utf-8 -*-
     3  
     4  source tests_base.sh
     5  
     6  ## collections
     7  
     8  ${CCSCLI_BIN} collections list || fail "failed to list collections"
     9  
    10  BASE_COLLECTION_COUNT=2
    11  
    12  # we expect 1 collections : linux 
    13  ${CCSCLI_BIN} collections list -ojson | ${JQ} ". | length == ${BASE_COLLECTION_COUNT}" || fail "(first) expected exactly ${BASE_COLLECTION_COUNT} collection"
    14  
    15  # install an extra collection
    16  ${CCSCLI} collections install breakteam/mysql || fail "failed to install collection"
    17  
    18  BASE_COLLECTION_COUNT=$(($BASE_COLLECTION_COUNT+1))
    19  
    20  # we should now have 2 collections :)
    21  ${CCSCLI_BIN} collections list -ojson | ${JQ} ". | length == ${BASE_COLLECTION_COUNT}" || fail "(post install) expected exactly ${BASE_COLLECTION_COUNT} collection"
    22  
    23  # remove the collection
    24  ${CCSCLI} collections remove breakteam/mysql || fail "failed to remove collection"
    25  
    26  BASE_COLLECTION_COUNT=$(($BASE_COLLECTION_COUNT-1))
    27  
    28  # we expect 1 collections : linux 
    29  ${CCSCLI_BIN} collections list -ojson | ${JQ} ". | length == ${BASE_COLLECTION_COUNT}" || fail "(post remove) expected exactly ${BASE_COLLECTION_COUNT} collection"
    30