VirtualBox

Changeset 102534 in vbox for trunk/src/VBox/Main/testcase


Ignore:
Timestamp:
Dec 8, 2023 11:06:41 AM (14 months ago)
Author:
vboxsync
Message:

Main/Unattended: Renamed the attribute "IUnattended::password" to "IUnattended::userPassword". Added new getter/setter attribute "IUnattended::adminPassword", to set a dedicated admin / root password. If not specified explicitly, the password from "IUnattended::userPassword" will be used. Extended testcases. bugref:10554

Location:
trunk/src/VBox/Main/testcase
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/testcase/tstUnattendedScript-1.expected

    r102416 r102534  
    313101=vboxuser
    323202=changeme
    33 03=changeme
     3303=adminpw
    343404=VBox & VBox;
    353505=911
     
    757501=vboxuser
    767602=changeme
    77 03=changeme
     7703=adminpw
    787804=VBox & VBox;
    797905=911
     
    11911901=vboxuser
    12012002=changeme
    121 03=changeme
     12103=adminpw
    12212204='VBox & VBox;'
    12312305=911
     
    16316301=vboxuser
    16416402=changeme
    165 03=changeme
     16503=adminpw
    16616604='VBox & VBox;'
    16716705=911
     
    20720701=vboxuser
    20820802=changeme
    209 03=changeme
     20903=adminpw
    21021004=VBox & VBox;
    21121105=911
     
    25125101=vboxuser
    25225202=changeme
    253 03=changeme
     25303=adminpw
    25425404=VBox & VBox;
    25525505=911
     
    29529501=vboxuser
    29629602=changeme
    297 03=changeme
     29703=adminpw
    29829804=VBox & VBox;
    29929905=911
     
    33933901=vboxuser
    34034002=changeme
    341 03=changeme
     34103=adminpw
    34234204=VBox & VBox;
    34334305=911
     
    384384
    385385/*
    386  * SHAcrypt 512. Contains the word "changeme" as hashed results.
     386 * SHAcrypt 512. Contains the word "changeme" (01) and "adminpw" (02) as hashed results.
    387387 * Note: This uses a fixed salt ("testcase123") within UnattendedScript.cpp, so that we can compare the outputs.
    388388 */
    38938901=$6$testcase123$AtdiLq2Dp.l/NRkh9/9Ai6Eapd6d0bGxCOmqErpuGa4unRjiohzK5YERWtLHKvAYx26X0YhIrgSFRimkaLToI1
    390 02=$6$testcase123$AtdiLq2Dp.l/NRkh9/9Ai6Eapd6d0bGxCOmqErpuGa4unRjiohzK5YERWtLHKvAYx26X0YhIrgSFRimkaLToI1
    391 
     39002=$6$testcase123$.ul/vC02q6oasrgQH/gqtOwHCo0jALPhIY63uypm0Mb2kJeDT0yedResX/mMNVZkm0fuMj24tpxs9gMAm7sEC0
     391
  • trunk/src/VBox/Main/testcase/tstUnattendedScript-1.template

    r102416 r102534  
    384384
    385385/*
    386  * SHAcrypt 512. Contains the word "changeme" as hashed results.
     386 * SHAcrypt 512. Contains the word "changeme" (01) and "adminpw" (02) as hashed results.
    387387 * Note: This uses a fixed salt ("testcase123") within UnattendedScript.cpp, so that we can compare the outputs.
    388388 */
  • trunk/src/VBox/Main/testcase/tstUnattendedScript.cpp

    r102381 r102534  
    5959{
    6060    mStrUser                            = "vboxuser";
    61     mStrPassword                        = "changeme";
     61    mStrUserPassword                    = "changeme";
     62    mStrAdminPassword                   = "adminpw";
    6263    mStrFullUserName                    = "VBox & VBox;";
    6364    mStrProductKey                      = "911";
     
    168169}
    169170
    170 HRESULT Unattended::getPassword(com::Utf8Str &password)
     171HRESULT Unattended::getUserPassword(com::Utf8Str &password)
    171172{
    172173    RT_NOREF(password);
     
    174175}
    175176
    176 HRESULT Unattended::setPassword(const com::Utf8Str &password)
     177HRESULT Unattended::setUserPassword(const com::Utf8Str &password)
     178{
     179    RT_NOREF(password);
     180    return E_NOTIMPL;
     181}
     182
     183HRESULT Unattended::getAdminPassword(com::Utf8Str &password)
     184{
     185    RT_NOREF(password);
     186    return E_NOTIMPL;
     187}
     188
     189HRESULT Unattended::setAdminPassword(const com::Utf8Str &password)
    177190{
    178191    RT_NOREF(password);
     
    544557}
    545558
    546 Utf8Str const &Unattended::i_getPassword() const
    547 {
    548     return mStrPassword;
     559Utf8Str const &Unattended::i_getUserPassword() const
     560{
     561    return mStrUserPassword;
     562}
     563
     564Utf8Str const &Unattended::i_getAdminPassword() const
     565{
     566    /* If no Administrator / 'root' password is being set, the user password will be used instead.
     567     * Also see API documentation. */
     568    return mStrAdminPassword.isEmpty() ? mStrUserPassword : mStrAdminPassword;
    549569}
    550570
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette