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

     1  #! /usr/bin/env bash
     2  # -*- coding: utf-8 -*-
     3  
     4  source tests_base.sh
     5  
     6  ## machines
     7  
     8  ${CCSCLI} machines list -ojson | ${JQ} '. | length == 1' || fail "expected exactly one machine"
     9  
    10  # add a new machine
    11  ${CCSCLI} machines add -a -f ./test_machine.yaml CiTestMachine -ojson || fail "expected exactly one machine"
    12  ${CCSCLI} machines list -ojson | ${JQ} '. | length == 2' || fail "expected exactly one machine"
    13  ${CCSCLI} machines delete CiTestMachine -ojson || fail "expected exactly one machine"
    14  ${CCSCLI} machines list -ojson | ${JQ} '. | length == 1' || fail "expected exactly one machine"
    15  
    16  #try register/validate
    17  ${CCSCLI} lapi register  --machine CiTestMachineRegister -f new_machine.yaml
    18  #the newly added machine isn't validated yet
    19  ${CCSCLI} machines list -ojson | ${JQ} '.[1].isValidated == null' || fail "machine shouldn't be validated"
    20  ${CCSCLI} machines validate CiTestMachineRegister  || fail "failed to validate machine"
    21  ${CCSCLI} machines list -ojson | ${JQ} '.[1].isValidated == true' || fail "machine should be validated"
    22