tests_post-install_3machines.sh 1022 B

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