Skip to content

Commit

Permalink
[#345] add tests for multiple deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
ablatov committed Oct 1, 2018
1 parent fc5af1d commit 191b935
Showing 1 changed file with 77 additions and 17 deletions.
94 changes: 77 additions & 17 deletions tests/robot/5_check_edi_multi_versioned_models.robot
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Test Teardown Run Keywords
Check EDI availability in all enclaves
[Setup] NONE
[Documentation] Try to connect to EDI in each enclave
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
:FOR ${enclave} IN @{ENCLAVES}
\ ${edi_state} = Run EDI inspect ${enclave}
\ Log ${edi_state}
Expand All @@ -27,7 +27,7 @@ Check EDI availability in all enclaves

Check EDI deploy 2 models with different versions but the same id
[Setup] NONE
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI deploy ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_IMAGE_1}
Should Be Equal As Integers ${resp.rc} 0
${resp}= Check model started ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID} ${TEST_MODEL_1_VERSION}
Expand All @@ -38,7 +38,7 @@ Check EDI deploy 2 models with different versions but the same id
Should contain ${resp} "model_version": "${TEST_MODEL_2_VERSION}"

Check EDI undeploy 1 of 2 models with different versions but the same id
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI undeploy with version ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID} ${TEST_MODEL_1_VERSION}
Should Be Equal As Integers ${resp.rc} 0
${resp}= Run EDI inspect by model id ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID}
Expand All @@ -47,7 +47,7 @@ Check EDI undeploy 1 of 2 models with different versions but the same id
Should contain ${resp.stdout} ${TEST_MODEL_IMAGE_2}

Check EDI undeploy all model instances by version
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI scale with version ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID} 2 ${TEST_MODEL_1_VERSION}
Should Be Equal As Integers ${resp.rc} 0
${resp}= Run EDI inspect with parse by model id ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID}
Expand All @@ -66,13 +66,31 @@ Check EDI undeploy all model instances by version
Should contain ${resp.stdout} |${TEST_MODEL_2_VERSION}

Check EDI undeploy 1 of 2 models without version
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI undeploy without version ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID}
Should Be Equal As Integers ${resp.rc} 2
Should contain ${resp.stderr} Please specify version of model

Check EDI undeploy all versioned model instances by id=*
[Documentation] Try to undeploy all models by id=* through EDI console
[Tags] edi cli enclave multi_versions
${resp}= Run EDI undeploy without version ${MODEL_TEST_ENCLAVE} '*'
Should Be Equal As Integers ${resp.rc} 0
${resp}= Run EDI inspect by model id ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID}
Should Be Equal As Integers ${resp.rc} 0
Should be empty ${resp.stdout}

Check EDI undeploy all versioned model instances by versions=*
[Documentation] Try to undeploy all models by versions=* through EDI console
[Tags] edi cli enclave multi_versions
${resp}= Run EDI undeploy with version ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID} '*'
Should Be Equal As Integers ${resp.rc} 0
${resp}= Run EDI inspect by model id ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID}
Should Be Equal As Integers ${resp.rc} 0
Should be empty ${resp.stdout}

Check EDI scale up 1 of 2 models with different versions but the same id
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI scale with version ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID} 2 ${TEST_MODEL_1_VERSION}
Should Be Equal As Integers ${resp.rc} 0
${resp}= Run EDI inspect with parse by model id ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID}
Expand All @@ -84,7 +102,7 @@ Check EDI scale up 1 of 2 models with different versions but the same id
Verify model info from edi ${model_2} ${TEST_MODEL_ID} ${TEST_MODEL_IMAGE_2} ${TEST_MODEL_2_VERSION} 1

Check EDI scale down 1 of 2 models with different versions but the same id
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI scale with version ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID} 2 ${TEST_MODEL_1_VERSION}
Should Be Equal As Integers ${resp.rc} 0
${resp}= Run EDI inspect with parse by model id ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID}
Expand All @@ -106,64 +124,106 @@ Check EDI scale down 1 of 2 models with different versions but the same id
Verify model info from edi ${model_2} ${TEST_MODEL_ID} ${TEST_MODEL_IMAGE_2} ${TEST_MODEL_2_VERSION} 1

Check EDI scale up 1 of 2 models by invalid version
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI scale with version ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID} 2 ${TEST_MODEL_1_VERSION}121
Should Be Equal As Integers ${resp.rc} 2
Should contain ${resp.stderr} No one model can be found

Check EDI scale up 1 of 2 models without version
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI scale ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID} 2
Should Be Equal As Integers ${resp.rc} 2
Should contain ${resp.stderr} Please specify version of model

Check EDI scale up all instances for 2 models(diff versions) by versions=*
[Documentation] Try to scale up 2 models with different versions but the same id by all versions through EDI console
[Tags] edi cli enclave multi_versions
${resp}= Run EDI scale with version ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID} 2 '*'
Should Be Equal As Integers ${resp.rc} 0
${resp}= Run EDI inspect with parse by model id ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID}
${model_1}= Find model information in edi ${resp} ${TEST_MODEL_ID} ${TEST_MODEL_1_VERSION}
Log ${model_1}
${model_2}= Find model information in edi ${resp} ${TEST_MODEL_ID} ${TEST_MODEL_2_VERSION}
Log ${model_2}
Verify model info from edi ${model_1} ${TEST_MODEL_ID} ${TEST_MODEL_IMAGE_1} ${TEST_MODEL_1_VERSION} 2
Verify model info from edi ${model_2} ${TEST_MODEL_ID} ${TEST_MODEL_IMAGE_2} ${TEST_MODEL_2_VERSION} 2

Check EDI scale up all instances for 2 models(diff versions) by id=*
[Documentation] Try to scale up 2 models with different versions but the same id by all ids through EDI console
[Tags] edi cli enclave multi_versions
${resp}= Run EDI scale ${MODEL_TEST_ENCLAVE} '*' 2
Should Be Equal As Integers ${resp.rc} 0
${resp}= Run EDI inspect with parse by model id ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID}
${model_1}= Find model information in edi ${resp} ${TEST_MODEL_ID} ${TEST_MODEL_1_VERSION}
Log ${model_1}
${model_2}= Find model information in edi ${resp} ${TEST_MODEL_ID} ${TEST_MODEL_2_VERSION}
Log ${model_2}
Verify model info from edi ${model_1} ${TEST_MODEL_ID} ${TEST_MODEL_IMAGE_1} ${TEST_MODEL_1_VERSION} 2
Verify model info from edi ${model_2} ${TEST_MODEL_ID} ${TEST_MODEL_IMAGE_2} ${TEST_MODEL_2_VERSION} 2

Check EDI model inspect by model id return 2 models
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI inspect by model id ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID}
Should Be Equal As Integers ${resp.rc} 0
Should contain ${resp.stdout} ${TEST_MODEL_IMAGE_1}
Should contain ${resp.stdout} ${TEST_MODEL_IMAGE_2}

Check EDI model inspect by model version return 1 model
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI inspect by model version ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_1_VERSION}
Should Be Equal As Integers ${resp.rc} 0
Should contain ${resp.stdout} ${TEST_MODEL_IMAGE_1}
Should not contain ${resp.stdout} ${TEST_MODEL_IMAGE_2}

Check EDI model inspect by model id and version return 1 model
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI inspect by model id and model version ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID} ${TEST_MODEL_1_VERSION}
Should Be Equal As Integers ${resp.rc} 0
Should contain ${resp.stdout} ${TEST_MODEL_IMAGE_1}
Should not contain ${resp.stdout} ${TEST_MODEL_IMAGE_2}

Check EDI model inspect by invalid model id
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI inspect by model id ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID}test
Should Be Equal As Integers ${resp.rc} 0
Should be empty ${resp.stdout}

Check EDI model inspect by invalid model version
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI inspect by model version ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_1_VERSION}test
Should Be Equal As Integers ${resp.rc} 0
Should be empty ${resp.stdout}

Check EDI model inspect by invalid model id and invalid version
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI inspect by model id and model version ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID}test ${TEST_MODEL_1_VERSION}test
Should Be Equal As Integers ${resp.rc} 0
Should be empty ${resp.stdout}

Check EDI model inspect by invalid model id and valid version
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI inspect by model id and model version ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID}test ${TEST_MODEL_1_VERSION}
Should Be Equal As Integers ${resp.rc} 0
Should be empty ${resp.stdout}

Check EDI model inspect by valid model id and invalid version
[Tags] edi cli enclave multi_versions
[Tags] edi cli enclave multi_versions
${resp}= Run EDI inspect by model id and model version ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID} ${TEST_MODEL_1_VERSION}test
Should Be Equal As Integers ${resp.rc} 0
Should be empty ${resp.stdout}

Check EDI model inspect by model id=* return all models
[Documentation] Try to inspect 2 models by all ids through EDI console
[Tags] edi cli enclave multi_versions
${resp}= Run EDI inspect by model id ${MODEL_TEST_ENCLAVE} '*'
Should Be Equal As Integers ${resp.rc} 0
Should contain ${resp.stdout} ${TEST_MODEL_IMAGE_1}
Should contain ${resp.stdout} ${TEST_MODEL_IMAGE_2}

Check EDI model inspect by model version=* return all models
[Documentation] Try to inspect 2 models by all versions through EDI console
[Tags] edi cli enclave multi_versions
${resp}= Run EDI inspect by model id and model version ${MODEL_TEST_ENCLAVE} ${TEST_MODEL_ID} '*'
Should Be Equal As Integers ${resp.rc} 0
Should contain ${resp.stdout} ${TEST_MODEL_IMAGE_1}
Should contain ${resp.stdout} ${TEST_MODEL_IMAGE_2}

0 comments on commit 191b935

Please sign in to comment.