Skip to content

Commit

Permalink
test: extend test coverage by testing user directory cleanup on removal
Browse files Browse the repository at this point in the history
The integration tests only test that removing a user works, but not the
option to also clean their user directory.
  • Loading branch information
jelly committed Jan 28, 2025
1 parent 781f63a commit ce54d90
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/verify/check-users
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,20 @@ class TestAccounts(testlib.MachineCase):
b.wait_visible("#accounts")
b.wait_not_in_text('#accounts-list', "Anton Arbitrary")

m.execute("useradd --create-home barney")
m.execute("echo barney:foobar | chpasswd")
m.execute("runuser -u barney -- touch /home/barney/test.txt")
m.execute("test -f /home/barney/test.txt")

with b.wait_timeout(30):
b.wait_in_text('#accounts-list', "barney")
performUserAction(b, 'barney', 'Delete')
b.set_checked("#account-confirm-delete-files", val=True)
b.click('#account-confirm-delete-dialog button.apply')
b.wait_not_present('#account-confirm-delete-dialog')
m.execute("! test -f /home/barney/test.txt")
b.wait_not_in_text('#accounts-list', "barney")

# Attempt a real name with a colon
b.click('#accounts-create')
b.wait_visible('#accounts-create-dialog')
Expand Down

0 comments on commit ce54d90

Please sign in to comment.