Commit 540ff21a authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

Add new functionality to recover uuid from register service if username is not on environment

parent afb12523
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -29,5 +29,6 @@ class CapifUserManager():
        for uuid, stored_user in self.register_users.items():
        for uuid, stored_user in self.register_users.items():
            if stored_user == username:
            if stored_user == username:
                return uuid
                return uuid
        return None


CAPIF_USERS = CapifUserManager()
CAPIF_USERS = CapifUserManager()
 No newline at end of file
+5 −0
Original line number Original line Diff line number Diff line
@@ -6,6 +6,7 @@ Library Collections
Library             OperatingSystem
Library             OperatingSystem
Library             XML
Library             XML
Library             Telnet
Library             Telnet
Library    String




*** Variables ***
*** Variables ***
@@ -441,6 +442,10 @@ Delete User At Register
        ${user_uuid}=    Call Method    ${CAPIF_USERS}    get_user_uuid    ${username}
        ${user_uuid}=    Call Method    ${CAPIF_USERS}    get_user_uuid    ${username}
    END
    END


    IF   "${user_uuid}" == "${NONE}"
        ${user_uuid}=   Get User Uuid At Register    ${username}
    END

    ${resp}=    Delete User Admin Register Request   ${user_uuid}
    ${resp}=    Delete User Admin Register Request   ${user_uuid}


    Should Be Equal As Strings    ${resp.status_code}    204
    Should Be Equal As Strings    ${resp.status_code}    204
+3 −9
Original line number Original line Diff line number Diff line
@@ -21,8 +21,8 @@ ${BACKUP_DIRECTORY} backup
${RESULT_FOLDER}                    /opt/robot-tests/results
${RESULT_FOLDER}                    /opt/robot-tests/results
${OUTPUT_ZIP_FILE}                  entities_loaded.zip
${OUTPUT_ZIP_FILE}                  entities_loaded.zip


${USER_PASSWORD}                    umapassword
${USER_PASSWORD}                    password
${USERNAME_PREFIX}                  uma
${USERNAME_PREFIX}                  user
${DESCRIPTION}                      Testing purpouse
${DESCRIPTION}                      Testing purpouse




@@ -82,16 +82,10 @@ Remove Client Users


    FOR    ${username}    IN    @{entities_dictionary}
    FOR    ${username}    IN    @{entities_dictionary}
        Log    ${username}=${entities_dictionary}[${username}]
        Log    ${username}=${entities_dictionary}[${username}]
        Run Keyword And Continue On Failure    ${username}
        Run Keyword And Continue On Failure   Delete User At Register  username=${username}
    END
    END


    ${result}=    Run Process    ls    -l
    ${result}=    Run Process    ls    -l


    Log Many    ${result.stdout}
    Log Many    ${result.stdout}

*** Keywords ***
Delete User
    [Arguments]    ${username}
    ${user_uuid}=    Get User Uuid At Register    ${username}
    Delete User Admin Register Request    ${user_uuid}