From: selvi.j Date: Thu, 22 Jun 2023 07:32:46 +0000 (+0000) Subject: Fix basic_15 and quotas_01 to update the user with new password X-Git-Tag: release-v14.0-start~7 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F66%2F13566%2F2;p=osm%2Ftests.git Fix basic_15 and quotas_01 to update the user with new password Change-Id: I7905909e2106154f9867030ef94af0ece7030286 Signed-off-by: selvi.j --- diff --git a/robot-systest/lib/user_lib.robot b/robot-systest/lib/user_lib.robot index b786a9f..4e5893c 100644 --- a/robot-systest/lib/user_lib.robot +++ b/robot-systest/lib/user_lib.robot @@ -26,6 +26,17 @@ Create User [Return] ${stdout} +Update User Password + [Arguments] ${user_name} ${user_password} ${user_new_password} + + Should Not Be Empty ${user_name} + Should Not Be Empty ${user_password} + Should Not Be Empty ${user_new_password} + ${rc} ${stdout}= Run and Return RC and Output osm user-update ${user_name} --current-password ${user_password} --new-password ${user_new_password} + Log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} + + Update User Role [Arguments] ${user_name} ${project_name} ${role_name} diff --git a/robot-systest/testsuite/basic_15-rbac_configurations.robot b/robot-systest/testsuite/basic_15-rbac_configurations.robot index a0341eb..4831fdc 100644 --- a/robot-systest/testsuite/basic_15-rbac_configurations.robot +++ b/robot-systest/testsuite/basic_15-rbac_configurations.robot @@ -30,6 +30,7 @@ Suite Teardown Run Keyword And Ignore Error Suite Cleanup # User, project and roles to use ${user_name} basic_15_test_user ${user_password} Basic_15_user_pass +${user_new_password} Basic_15_new_pass ${user_role} project_user ${user_project} admin ${project_name} basic_15_test_project @@ -54,7 +55,8 @@ Assign Role To User Run Action As User - ${rc} ${stdout}= Run And Return RC And Output OSM_USER=${user_name} OSM_PROJECT=${user_project} OSM_PASSWORD=${user_password} osm ns-list + Update User Password ${user_name} ${user_password} ${user_new_password} + ${rc} ${stdout}= Run And Return RC And Output OSM_USER=${user_name} OSM_PROJECT=${user_project} OSM_PASSWORD=${user_new_password} osm ns-list Should Be Equal As Integers ${rc} ${success_return_code} diff --git a/robot-systest/testsuite/quotas_01-quota_enforcement.robot b/robot-systest/testsuite/quotas_01-quota_enforcement.robot index 9a470aa..f37412d 100644 --- a/robot-systest/testsuite/quotas_01-quota_enforcement.robot +++ b/robot-systest/testsuite/quotas_01-quota_enforcement.robot @@ -18,6 +18,7 @@ Library String Library Collections Resource %{ROBOT_DEVOPS_FOLDER}/lib/project_lib.robot +Resource %{ROBOT_DEVOPS_FOLDER}/lib/user_lib.robot Force Tags quotas_01 cluster_main daily regression @@ -39,6 +40,7 @@ ${project_3_quotas} vnfds=5,nsds=,ns_instances= # User name and password for project ${user_name} quotas_01_user ${user_password} Quotas_01_pass +${user_new_password} Quotas_01_new_pass ${success_return_code} 0 @@ -71,6 +73,7 @@ Create User In Projects Should Be Equal As Integers ${rc} ${success_return_code} Check If User Is Assigned To Project ${user_name} ${project_1_name} Check If User Is Assigned To Project ${user_name} ${project_2_name} + Update User Password ${user_name} ${user_password} ${user_new_password} Change First Project Name to Third Project Name @@ -87,8 +90,8 @@ Change First Project Name to Third Project Name Create VNFDs On Third Project Until Exceed Quota - Create VNFD In Project ${project_3_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_password} override='id=v1;product-name=v1' - Run Keyword And Expect Error * Create VNFD In Project ${project_3_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_password} override='id=v2;product-name=v2' + Create VNFD In Project ${project_3_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_new_password} override='id=v1;product-name=v1' + Run Keyword And Expect Error * Create VNFD In Project ${project_3_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_new_password} override='id=v2;product-name=v2' Increase Third Project Quotas @@ -100,25 +103,25 @@ Increase Third Project Quotas Create More VNFDs On Third Project Until Exceed Quota - Create VNFD In Project ${project_3_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_password} override='id=v2;product-name=v2' - Create VNFD In Project ${project_3_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_password} override='id=v3;product-name=v3' - Create VNFD In Project ${project_3_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_password} override='id=v4;product-name=v4' - Create VNFD In Project ${project_3_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_password} override='id=v5;product-name=v5' - Run Keyword And Expect Error * Create VNFD In Project ${project_3_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_password} override='id=v6;product-name=v6' + Create VNFD In Project ${project_3_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_new_password} override='id=v2;product-name=v2' + Create VNFD In Project ${project_3_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_new_password} override='id=v3;product-name=v3' + Create VNFD In Project ${project_3_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_new_password} override='id=v4;product-name=v4' + Create VNFD In Project ${project_3_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_new_password} override='id=v5;product-name=v5' + Run Keyword And Expect Error * Create VNFD In Project ${project_3_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_new_password} override='id=v6;product-name=v6' Create VNFDs On Second Project Until Exceed Quota - Create VNFD In Project ${project_2_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_password} override='id=vp2_1;product-name=vp2_1' - Run Keyword And Expect Error * Create VNFD In Project ${project_2_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_password} override='id=vp2_2;product-name=vp2_2' + Create VNFD In Project ${project_2_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_new_password} override='id=vp2_1;product-name=vp2_1' + Run Keyword And Expect Error * Create VNFD In Project ${project_2_name} '%{PACKAGES_FOLDER}/${vnfd_pkg}' ${user_name} ${user_new_password} override='id=vp2_2;product-name=vp2_2' Check Project Scopes - ${rc} ${stdout}= Run And Return RC And Output osm --project ${project_3_name} --password ${user_password} --user ${user_name} vnfpkg-show vp2_1 + ${rc} ${stdout}= Run And Return RC And Output osm --project ${project_3_name} --password ${user_new_password} --user ${user_name} vnfpkg-show vp2_1 Log ${stdout} Should Not Be Equal As Integers ${rc} ${success_return_code} - ${rc} ${stdout}= Run And Return RC And Output osm --project ${project_2_name} --password ${user_password} --user ${user_name} vnfpkg-show v1 + ${rc} ${stdout}= Run And Return RC And Output osm --project ${project_2_name} --password ${user_new_password} --user ${user_name} vnfpkg-show v1 Log ${stdout} Should Not Be Equal As Integers ${rc} ${success_return_code} @@ -126,17 +129,17 @@ Check Project Scopes Delete Second Project VNFD [Tags] cleanup - Delete VNFD In Project ${project_2_name} vp2_1 ${user_name} ${user_password} + Delete VNFD In Project ${project_2_name} vp2_1 ${user_name} ${user_new_password} Delete Third Project VNFDs [Tags] cleanup - Delete VNFD In Project ${project_3_name} v1 ${user_name} ${user_password} - Delete VNFD In Project ${project_3_name} v2 ${user_name} ${user_password} - Delete VNFD In Project ${project_3_name} v3 ${user_name} ${user_password} - Delete VNFD In Project ${project_3_name} v4 ${user_name} ${user_password} - Delete VNFD In Project ${project_3_name} v5 ${user_name} ${user_password} + Delete VNFD In Project ${project_3_name} v1 ${user_name} ${user_new_password} + Delete VNFD In Project ${project_3_name} v2 ${user_name} ${user_new_password} + Delete VNFD In Project ${project_3_name} v3 ${user_name} ${user_new_password} + Delete VNFD In Project ${project_3_name} v4 ${user_name} ${user_new_password} + Delete VNFD In Project ${project_3_name} v5 ${user_name} ${user_new_password} Delete Second Project After Removing User From It @@ -161,12 +164,12 @@ Delete Third Project *** Keywords *** Suite Cleanup - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_2_name} vp2_1 ${user_name} ${user_password} - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v1 ${user_name} ${user_password} - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v2 ${user_name} ${user_password} - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v3 ${user_name} ${user_password} - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v4 ${user_name} ${user_password} - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v5 ${user_name} ${user_password} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_2_name} vp2_1 ${user_name} ${user_new_password} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v1 ${user_name} ${user_new_password} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v2 ${user_name} ${user_new_password} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v3 ${user_name} ${user_new_password} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v4 ${user_name} ${user_new_password} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete VNFD In Project ${project_3_name} v5 ${user_name} ${user_new_password} Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete Project ${project_1_name} Run Keyword If Any Tests Failed Delete Project ${project_2_name} Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete Project ${project_3_name}