Jump to: navigation, search

V4/User Life-Cycle Management/tests


Test stageuser

Implemented in ipatests.test_xmlrpc.test_stageuser_plugin.test_stageuser

Like other tests in the test_xmlrpc suite, these tests should run on a clean IPA installation, or possibly after other similar tests.

Test case: Try to retrieve non-existent "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_show tuser1

Expected results

The command fails with this error:

tuser1: user not found


Test case: Try to update non-existent "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --first=Foo

Expected results

The command fails with this error:

tuser1: user not found


Test case: Try to delete non-existent "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_del tuser1

Expected results

The command fails with this error:

tuser1: user not found


Test case: Try to rename non-existent "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --setattr='uid=tuser'

Expected results

The command fails with this error:

tuser1: user not found


Test case: Create "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --first=Test --last=User1 --class=testusers

Expected results

The command succeeds with this output:

-------------------------
Added stage user "tuser1"
-------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Full name: Test User1
  Display name: Test User1
  Initials: TU
  Home directory: /home/tuser1
  GECOS: Test User1
  Login shell: /bin/sh
  Kerberos principal: tuser1@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Class: testusers
  Password: False
  Kerberos keys available: False


Test case: Try to create duplicate "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --first=Test --last=User1

Expected results

The command fails with this error:

user with name "tuser1" already exists


Test case: Retrieve "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_show tuser1

Expected results

The command succeeds with this output:

  User login: tuser1
  First name: Test
  Last name: User1
  Home directory: /home/tuser1
  Login shell: /bin/sh
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Class: testusers
  Password: False
  Kerberos keys available: False


Test case: Remove userclass for user "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --class=

Expected results

The command succeeds with this output:

----------------------------
Modified stage user "tuser1"
----------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Home directory: /home/tuser1
  Login shell: /bin/sh
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Search for "tuser1" with all=True

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_find tuser1 --all

Expected results

The command succeeds with this output:

--------------
1 user matched
--------------
  dn: uid=tuser1,cn=staged users,cn=accounts,cn=provisioning,$SUFFIX
  User login: tuser1
  First name: Test
  Last name: User1
  Full name: Test User1
  Display name: Test User1
  Initials: TU
  Home directory: /home/tuser1
  GECOS: Test User1
  Login shell: /bin/sh
  Kerberos principal: tuser1@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False
  description: __no_upg__
  ipauniqueid: autogenerate
  nsaccountlock: False
  objectclass: top, person, organizationalperson, inetorgperson, inetuser, posixaccount, krbprincipalaux, krbticketpolicyaux, ipaobject, ipasshuser, ipaSshGroupOfPubKeys, ipauser
----------------------------
Number of entries returned 1
----------------------------


Test case: Search for "tuser1" with pkey-only=True

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_find tuser1 --pkey_only

Expected results

The command succeeds with this output:

--------------
1 user matched
--------------
  User login: tuser1
----------------------------
Number of entries returned 1
----------------------------


Test case: Search for "tuser1" with minimal attributes

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_find tuser1

Expected results

The command succeeds with this output:

--------------
1 user matched
--------------
  User login: tuser1
  First name: Test
  Last name: User1
  Home directory: /home/tuser1
  Login shell: /bin/sh
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False
----------------------------
Number of entries returned 1
----------------------------


Test case: Search for all users

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_find

Expected results

The command succeeds with this output:

--------------
1 user matched
--------------
  User login: tuser1
  First name: Test
  Last name: User1
  Home directory: /home/tuser1
  Login shell: /bin/sh
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False
----------------------------
Number of entries returned 1
----------------------------


Test case: Try setting virtual attribute on "tuser1" using setattr

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --setattr='random=xyz123'

Expected results

The command fails with this error:

attribute "random" not allowed


Test case: Update "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --first=Finkle

Expected results

The command succeeds with this output:

----------------------------
Modified stage user "tuser1"
----------------------------
  User login: tuser1
  First name: Finkle
  Last name: User1
  Home directory: /home/tuser1
  Login shell: /bin/sh
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Try updating the krb ticket policy of "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --setattr='krbmaxticketlife=88000'

Expected results

The command fails with this error:

attribute "krbmaxticketlife" not allowed


Test case: Retrieve "tuser1" to verify update

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_show tuser1

Expected results

The command succeeds with this output:

  User login: tuser1
  First name: Finkle
  Last name: User1
  Home directory: /home/tuser1
  Login shell: /bin/sh
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Rename "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --setattr='uid=tuser'

Expected results

The command succeeds with this output:

----------------------------
Modified stage user "tuser1"
----------------------------
  User login: tuser
  First name: Finkle
  Last name: User1
  Home directory: /home/tuser1
  Login shell: /bin/sh
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Rename "tuser" to same value

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser --setattr='uid=tuser'

Expected results

The command fails with this error:

no modifications to be performed


Test case: Rename back "tuser"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser --setattr='uid=tuser1'

Expected results

The command succeeds with this output:

---------------------------
Modified stage user "tuser"
---------------------------
  User login: tuser1
  First name: Finkle
  Last name: User1
  Home directory: /home/tuser1
  Login shell: /bin/sh
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Delete "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_del tuser1

Expected results

The command succeeds with this output:

---------------------------
Deleted stage user "tuser1"
---------------------------


Test case: Try to delete non-existent "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_del tuser1

Expected results

The command fails with this error:

tuser1: user not found


Test case: Create user "tuser1" with krb ticket policy

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --first=Test --last=User1 --setattr='krbmaxticketlife=88000'

Expected results

The command fails with this error:

attribute "krbmaxticketlife" not allowed


Test case: Create "tuser1" with SSH public key

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --first=Test --sshpubkey='ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGAX3xAeLeaJggwTqMjxNwa6XHBUAikXPGMzEpVrlLDCZtv00djsFTBi38PkgxBJVkgRWMrcBsr/35lq7P6w8KGIwA8GI48Z0qBS2NBMJ2u9WQ2hjLN6GdMlo77O0uJY3251p12pCVIS/bHRSq8kHO2No8g7KA9fGGcagPfQH+ee3t7HUkpbQkFTmbPPN++r3V8oVUk5LxbryB3UIIVzNmcSIn3JrXynlvui4MixvrtX6zx+O/bBo68o8/eZD26QrahVbA09fivrn/4h3TM019Eu/c2jOdckfU3cHUV/3Tno5d6JicibyaoDDK7S/yjdn5jhaz8MSEayQvFkZkiF0L public key test' --last=User1

Expected results

The command succeeds with this output:

-------------------------
Added stage user "tuser1"
-------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Full name: Test User1
  Display name: Test User1
  Initials: TU
  Home directory: /home/tuser1
  GECOS: Test User1
  Login shell: /bin/sh
  Kerberos principal: tuser1@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  SSH public key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGAX3xAeLeaJggwTqMjxNwa6XHBUAikXPGMzEpVrlLDCZtv00djsFTBi38PkgxBJVkgRWMrcBsr/35lq7P6w8KGIwA8GI48Z0qBS2NBMJ2u9WQ2hjLN6GdMlo77O0uJY3251p12pCVIS/bHRSq8kHO2No8g7KA9fGGcagPfQH+ee3t7HUkpbQkFTmbPPN++r3V8oVUk5LxbryB3UIIVzNmcSIn3JrXynlvui4MixvrtX6zx+O/bBo68o8/eZD26QrahVbA09fivrn/4h3TM019Eu/c2jOdckfU3cHUV/3Tno5d6JicibyaoDDK7S/yjdn5jhaz8MSEayQvFkZkiF0L public key test
  Password: False
  Kerberos keys available: False
  SSH public key fingerprint: 13:67:6B:BF:4E:A2:05:8E:AE:25:8B:A1:31:DE:6F:1B public key test (ssh-rsa)


Test case: Add an illegal SSH public key to "u'tuser1'"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --sshpubkey='anal nathrach orth'\ bhais'\s bethad do che'\l de'\nmha'

Expected results

The command fails with this error:

invalid 'sshpubkey': invalid SSH public key


Test case: Delete "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_del tuser1

Expected results

The command succeeds with this output:

---------------------------
Deleted stage user "tuser1"
---------------------------


Test case: Create "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --first=Test --last=User1

Expected results

The command succeeds with this output:

-------------------------
Added stage user "tuser1"
-------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Full name: Test User1
  Display name: Test User1
  Initials: TU
  Home directory: /home/tuser1
  GECOS: Test User1
  Login shell: /bin/sh
  Kerberos principal: tuser1@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Create "tuser2"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser2 --first=Test --last=User2

Expected results

The command succeeds with this output:

-------------------------
Added stage user "tuser2"
-------------------------
  User login: tuser2
  First name: Test
  Last name: User2
  Full name: Test User2
  Display name: Test User2
  Initials: TU
  Home directory: /home/tuser2
  GECOS: Test User2
  Login shell: /bin/sh
  Kerberos principal: tuser2@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser2@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Make non-existent "tuser" the manager of "tuser2"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser2 --manager=tuser

Expected results

The command fails with this error:

manager tuser not found


Test case: Make stage user "tuser1" the manager of "tuser2"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser2 --manager=tuser1

Expected results

The command fails with this error:

manager tuser1 not found


Test case: Create Active "active_tuser1" that will be used as manager

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa user_add active_tuser1 --first=Test --last='Active user1' --class=testusers

Expected results

The command succeeds with this output:

--------------------------
Added user "active_tuser1"
--------------------------
  User login: active_tuser1
  First name: Test
  Last name: Active user1
  Full name: Test Active user1
  Display name: Test Active user1
  Initials: TA
  Home directory: /home/active_tuser1
  GECOS: Test Active user1
  Login shell: /bin/sh
  Kerberos principal: active_tuser1@IDM.LAB.BOS.REDHAT.COM
  Email address: active_tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Class: testusers
  Password: False
  Member of groups: ipausers
  Kerberos keys available: False


Test case: Make "active_tuser1" the manager of "tuser2"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser2 --manager=active_tuser1

Expected results

The command succeeds with this output:

----------------------------
Modified stage user "tuser2"
----------------------------
  User login: tuser2
  First name: Test
  Last name: User2
  Home directory: /home/tuser2
  Login shell: /bin/sh
  Email address: tuser2@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Manager: active_tuser1
  Password: False
  Kerberos keys available: False


Test case: Search for "tuser2" with manager "active_tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_find tuser2 --manager=active_tuser1

Expected results

The command succeeds with this output:

--------------
1 user matched
--------------
  User login: tuser2
  First name: Test
  Last name: User2
  Home directory: /home/tuser2
  Login shell: /bin/sh
  Email address: tuser2@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Manager: active_tuser1
  Password: False
  Kerberos keys available: False
----------------------------
Number of entries returned 1
----------------------------


Test case: Delete "tuser1" and "tuser2" at the same time

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_del tuser1

Expected results

The command succeeds with this output:

----------------------------------
Deleted stage user "tuser1,tuser2"
----------------------------------


Test case: Try to retrieve non-existent "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_show tuser1

Expected results

The command fails with this error:

tuser1: user not found


Test case: Try to update non-existent "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --first=Foo

Expected results

The command fails with this error:

tuser1: user not found


Test case: Test an invalid login name "+tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add '+tuser1' --first=Test --last=User1

Expected results

The command fails with this error:

invalid 'login': may only include letters, numbers, _, -, . and $


Test case: Test a login name that is too long "tuser1234567890123456789012345678901234567890"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1234567890123456789012345678901234567890 --first=Test --last=User1

Expected results

The command fails with this error:

invalid 'login': can be at most 32 characters


Test case: Test that validation is disabled on deletes

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_del '+tuser1'

Expected results

The command fails with this error:

+tuser1: user not found


Test case: Test that validation is disabled on show

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_show '+tuser1'

Expected results

The command fails with this error:

+tuser1: user not found


Test case: Test that validation is disabled on find

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_find '+tuser1'

Expected results

The command fails (return code 1), with this output:

---------------
0 users matched
---------------
----------------------------
Number of entries returned 0
----------------------------


Test case: Try to rename to invalid username "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --rename='+tuser1'

Expected results

The command fails with this error:

invalid 'rename': may only include letters, numbers, _, -, . and $


Test case: Try to rename to a username that is too long "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --rename=tuser1234567890123456789012345678901234567890

Expected results

The command fails with this error:

invalid 'login': can be at most 32 characters


Test case: Create "tuser1" with a full address

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --phone=410-555-1212 --street='123 Maple Rd' --last=User1 --postalcode=01234-5678 --first=Test --city=Anytown --state=MD

Expected results

The command succeeds with this output:

-------------------------
Added stage user "tuser1"
-------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Full name: Test User1
  Display name: Test User1
  Initials: TU
  Home directory: /home/tuser1
  GECOS: Test User1
  Login shell: /bin/sh
  Kerberos principal: tuser1@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Street address: 123 Maple Rd
  City: Anytown
  State/Province: MD
  ZIP: 01234-5678
  Telephone Number: 410-555-1212
  Password: False
  Kerberos keys available: False


Test case: Delete "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_del tuser1

Expected results

The command succeeds with this output:

---------------------------
Deleted stage user "tuser1"
---------------------------


Test case: Create "tuser1" with random password

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --random --last=User1 --first=Test

Expected results

The command succeeds with this output:

-------------------------
Added stage user "tuser1"
-------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Full name: Test User1
  Display name: Test User1
  Initials: TU
  Home directory: /home/tuser1
  GECOS: Test User1
  Login shell: /bin/sh
  Kerberos principal: tuser1@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Delete "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_del tuser1

Expected results

The command succeeds with this output:

---------------------------
Deleted stage user "tuser1"
---------------------------


Test case: Create "tuser2"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser2 --first=Test --last=User2

Expected results

The command succeeds with this output:

-------------------------
Added stage user "tuser2"
-------------------------
  User login: tuser2
  First name: Test
  Last name: User2
  Full name: Test User2
  Display name: Test User2
  Initials: TU
  Home directory: /home/tuser2
  GECOS: Test User2
  Login shell: /bin/sh
  Kerberos principal: tuser2@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser2@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Modify "tuser2" with random password

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser2 --random

Expected results

The command succeeds with this output:

----------------------------
Modified stage user "tuser2"
----------------------------
  User login: tuser2
  First name: Test
  Last name: User2
  Home directory: /home/tuser2
  Login shell: /bin/sh
  Email address: tuser2@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Delete "tuser2"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_del tuser2

Expected results

The command succeeds with this output:

---------------------------
Deleted stage user "tuser2"
---------------------------


Test case: Create user "tuser1" with upper-case principal

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --principal=TUSER1 --first=Test --last=User1

Expected results

The command succeeds with this output:

-------------------------
Added stage user "tuser1"
-------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Full name: Test User1
  Display name: Test User1
  Initials: TU
  Home directory: /home/tuser1
  GECOS: Test User1
  Login shell: /bin/sh
  Kerberos principal: tuser1@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Create user "tuser1" with bad realm in principal

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --principal='tuser1@NOTFOUND.ORG' --first=Test --last=User1

Expected results

The command fails with this error:

The realm for the principal does not match the realm for this IPA server


Test case: Create user "tuser1" with malformed principal

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --principal='tuser1@BAD@NOTFOUND.ORG' --first=Test --last=User1

Expected results

The command fails with this error:

Principal is not of the form user@REALM: 'tuser1@BAD@NOTFOUND.ORG'


Test case: Delete "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_del tuser1

Expected results

The command succeeds with this output:

---------------------------
Deleted stage user "tuser1"
---------------------------


Test case: Change default home directory

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa config_mod --homedirectory='/other-home'

Expected results

The command succeeds with this output:


Test case: Create user "tuser1" with different default home directory

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --first=Test --last=User1

Expected results

The command succeeds with this output:

-------------------------
Added stage user "tuser1"
-------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Full name: Test User1
  Display name: Test User1
  Initials: TU
  Home directory: /other-home/tuser1
  GECOS: Test User1
  Login shell: /bin/sh
  Kerberos principal: tuser1@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Reset default home directory

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa config_mod --homedirectory='/home'

Expected results

The command succeeds with this output:


Test case: Delete "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_del tuser1

Expected results

The command succeeds with this output:

---------------------------
Deleted stage user "tuser1"
---------------------------


Test case: Change default login shell

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa config_mod --defaultshell='/usr/bin/ipython'

Expected results

The command succeeds with this output:


Test case: Create user "tuser1" with different default login shell

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --first=Test --last=User1

Expected results

The command succeeds with this output:

-------------------------
Added stage user "tuser1"
-------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Full name: Test User1
  Display name: Test User1
  Initials: TU
  Home directory: /home/tuser1
  GECOS: Test User1
  Login shell: /usr/bin/ipython
  Kerberos principal: tuser1@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Reset default login shell

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa config_mod --defaultshell='/bin/sh'

Expected results

The command succeeds with this output:


Test case: Delete "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_del tuser1

Expected results

The command succeeds with this output:

---------------------------
Deleted stage user "tuser1"
---------------------------


Test case: Create stage "tuser1" without UPG (not supported option)

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --first=Test --last=User1 --last=True

Expected results

The command fails with this error:

Unknown option: noprivate


Test case: Create "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --first=Test --last=User1

Expected results

The command succeeds with this output:

-------------------------
Added stage user "tuser1"
-------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Full name: Test User1
  Display name: Test User1
  Initials: TU
  Home directory: /home/tuser1
  GECOS: Test User1
  Login shell: /bin/sh
  Kerberos principal: tuser1@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Make "active_tuser1" the manager of "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --manager=active_tuser1

Expected results

The command succeeds with this output:

----------------------------
Modified stage user "tuser1"
----------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Home directory: /home/tuser1
  Login shell: /bin/sh
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Manager: active_tuser1
  Password: False
  Kerberos keys available: False


Test case: Rename "active_tuser1 in new_active_tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa user_mod active_tuser1 --rename=new_active_tuser1

Expected results

The command succeeds with this output:

-----------------------------
Modified user "active_tuser1"
-----------------------------
  User login: new_active_tuser1
  First name: Test
  Last name: Active user1
  Home directory: /home/active_tuser1
  Login shell: /bin/sh
  Email address: active_tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Account disabled: False
  Class: testusers
  Password: False
  Member of groups: ipausers
  Kerberos keys available: False


Test case: Check manager of "tuser1" has been renamed "new_active_tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_find tuser1 --manager=new_active_tuser1

Expected results

The command succeeds with this output:

--------------
1 user matched
--------------
  User login: tuser1
  First name: Test
  Last name: User1
  Home directory: /home/tuser1
  Login shell: /bin/sh
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Manager: new_active_tuser1
  Password: False
  Kerberos keys available: False
----------------------------
Number of entries returned 1
----------------------------


Test case: Delete "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_del tuser1

Expected results

The command succeeds with this output:

---------------------------
Deleted stage user "tuser1"
---------------------------


Test case: Delete "new_active_tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa user_del new_active_tuser1

Expected results

The command succeeds with this output:

--------------------------------
Deleted user "new_active_tuser1"
--------------------------------


Test case: Create "tuser1" to be added to admin group

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --first=Test --last=User1

Expected results

The command succeeds with this output:

-------------------------
Added stage user "tuser1"
-------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Full name: Test User1
  Display name: Test User1
  Initials: TU
  Home directory: /home/tuser1
  GECOS: Test User1
  Login shell: /bin/sh
  Kerberos principal: tuser1@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Add "tuser1" to the admins group "admins"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa group_add_member admins --users=tuser1

Expected results

The command fails (return code 1), with this output:

  Group name: admins
  Description: Account administrators group
  Member users: admin
  Failed members: 
    member user: tuser1: no such entry
    member group: 
-------------------------
Number of members added 0
-------------------------


Test case: Retrieve admins group "admins" to verify membership is "admin"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa group_show admins

Expected results

The command succeeds with this output:

  Group name: admins
  Description: Account administrators group
  Member users: admin


Test case: Delete "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_del tuser1

Expected results

The command succeeds with this output:

---------------------------
Deleted stage user "tuser1"
---------------------------


Test case: Create u'tuser2'

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser2 --first=Test --last=User2

Expected results

The command succeeds with this output:

-------------------------
Added stage user "tuser2"
-------------------------
  User login: tuser2
  First name: Test
  Last name: User2
  Full name: Test User2
  Display name: Test User2
  Initials: TU
  Home directory: /home/tuser2
  GECOS: Test User2
  Login shell: /bin/sh
  Kerberos principal: tuser2@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser2@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Create "tuser1" with UID 999

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --first=Test --uid=999 --last=User1

Expected results

The command succeeds with this output:

-------------------------
Added stage user "tuser1"
-------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Full name: Test User1
  Display name: Test User1
  Initials: TU
  Home directory: /home/tuser1
  GECOS: Test User1
  Login shell: /bin/sh
  Kerberos principal: tuser1@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: 999
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Delete "tuser1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_del tuser1

Expected results

The command succeeds with this output:

---------------------------
Deleted stage user "tuser1"
---------------------------


Test case: Create "tuser1" with old DNA_MAGIC uid 999

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_add tuser1 --version=2.49 --uid=999 --last=User1 --first=Test

Expected results

The command succeeds with this output:

-------------------------
Added stage user "tuser1"
-------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Full name: Test User1
  Display name: Test User1
  Initials: TU
  Home directory: /home/tuser1
  GECOS: Test User1
  Login shell: /bin/sh
  Kerberos principal: tuser1@IDM.LAB.BOS.REDHAT.COM
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: <function <lambda> at 0x3077488>
  GID: <function <lambda> at 0x3077500>
  Password: False
  Kerberos keys available: False


Test case: Test an invalid preferredlanguage "abcdfghji-abcdfghji"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --preferredlanguage=abcdfghji-abcdfghji

Expected results

The command fails with this error:

invalid 'preferredlanguage': must match RFC 2068 - 14.4, e.g., "da, en-gb;q=0.8, en;q=0.7"


Test case: Test an invalid preferredlanguage "en-us;q=0,123"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --preferredlanguage='en-us;q=0,123'

Expected results

The command fails with this error:

invalid 'preferredlanguage': must match RFC 2068 - 14.4, e.g., "da, en-gb;q=0.8, en;q=0.7"


Test case: Test an invalid preferredlanguage "en-us;q=0.1234"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --preferredlanguage='en-us;q=0.1234'

Expected results

The command fails with this error:

invalid 'preferredlanguage': must match RFC 2068 - 14.4, e.g., "da, en-gb;q=0.8, en;q=0.7"


Test case: Test an invalid preferredlanguage "en-us;q=1.1"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --preferredlanguage='en-us;q=1.1'

Expected results

The command fails with this error:

invalid 'preferredlanguage': must match RFC 2068 - 14.4, e.g., "da, en-gb;q=0.8, en;q=0.7"


Test case: Test an invalid preferredlanguage "en-us;q=1.0000"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --preferredlanguage='en-us;q=1.0000'

Expected results

The command fails with this error:

invalid 'preferredlanguage': must match RFC 2068 - 14.4, e.g., "da, en-gb;q=0.8, en;q=0.7"


Test case: Set preferredlanguage "en-US;q=0.987 , en, abcdfgh-abcdefgh;q=1 , a;q=1.000"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --preferredlanguage='en-US;q=0.987 , en, abcdfgh-abcdefgh;q=1        , a;q=1.000'

Expected results

The command succeeds with this output:

----------------------------
Modified stage user "tuser1"
----------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Home directory: /home/tuser1
  Login shell: /bin/sh
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Preferred Language: en-US;q=0.987 , en, abcdfgh-abcdefgh;q=1        , a;q=1.000
  Password: False
  Kerberos keys available: False


Test case: Set preferredlanguage "*"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --preferredlanguage='*'

Expected results

The command succeeds with this output:

----------------------------
Modified stage user "tuser1"
----------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Home directory: /home/tuser1
  Login shell: /bin/sh
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Preferred Language: *
  Password: False
  Kerberos keys available: False


Test case: Set principal expiration "2020-12-07T19:54:13Z"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --principal_expiration='2020-12-07T19:54:13Z'

Expected results

The command succeeds with this output:

----------------------------
Modified stage user "tuser1"
----------------------------
  User login: tuser1
  First name: Test
  Last name: User1
  Home directory: /home/tuser1
  Login shell: /bin/sh
  Kerberos principal expiration: 20201207195413Z
  Email address: tuser1@idm.lab.bos.redhat.com
  UID: -1
  GID: -1
  Password: False
  Kerberos keys available: False


Test case: Set principal expiration "2020-12-07 19:54:13"

Autotest

{{{autotest}}}

Setup

See beginning of the Tests section

Actions

Run the following command:

ipa stageuser_mod tuser1 --principal_expiration='2020-12-07 19:54:13'

Expected results

The command fails with this error:

invalid 'principal_expiration': does not match any of accepted formats: %Y%m%d%H%M%SZ, %Y-%m-%dT%H:%M:%SZ, %Y-%m-%dT%H:%MZ, %Y-%m-%dZ, %Y-%m-%d %H:%M:%SZ, %Y-%m-%d %H:%MZ

Cleanup

ipa stageuser_del tuser1 --continue
ipa stageuser_del tuser2 --continue
ipa stageuser_del tuser --continue
ipa user_del active_tuser1 --continue
ipa user_del new_active_tuser1 --continue
ipa automember_default_group_remove --type=group