URL: https://github.com/SSSD/sssd/pull/5773
Author: sgoveas
 Title: #5773: TEST: usermod -d needs absolute path
Action: opened

PR body:
"""
usermod -d failed when it was given an empty string to update. This was
noticed in #5754. Updating test to check for modified home dir
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/5773/head:pr5773
git checkout pr5773
From 6f7a52671d01bd1f5259b9d97ecfa548e96d79d5 Mon Sep 17 00:00:00 2001
From: Steeve Goveas <sgov...@redhat.com>
Date: Mon, 6 Sep 2021 11:44:04 +0530
Subject: [PATCH] TEST: usermod -d needs absolute path

usermod -d failed when it was given an empty string to update. This was
noticed in #5754. Updating test to check for modified home dir
---
 src/tests/multihost/basic/conftest.py   | 2 +-
 src/tests/multihost/basic/test_files.py | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/tests/multihost/basic/conftest.py b/src/tests/multihost/basic/conftest.py
index 39c3ebdae9..3d0debb3aa 100644
--- a/src/tests/multihost/basic/conftest.py
+++ b/src/tests/multihost/basic/conftest.py
@@ -303,7 +303,7 @@ def files_domain_users_class(request, session_multihost):
     for user in no_home_users:
         useradd_cmd = "useradd --no-create-home %s" % (user)
         session_multihost.master[0].run_command(useradd_cmd)
-        usermod_cmd = "usermod -d '' %s" % (user)
+        usermod_cmd = "usermod -d /tmp %s" % (user)
         session_multihost.master[0].run_command(usermod_cmd)
 
     def teardown_files_domain_users():
diff --git a/src/tests/multihost/basic/test_files.py b/src/tests/multihost/basic/test_files.py
index 18c9bb9379..10b8b9f307 100644
--- a/src/tests/multihost/basic/test_files.py
+++ b/src/tests/multihost/basic/test_files.py
@@ -53,11 +53,11 @@ def test_files_enumeration(self, multihost):
         cmd = multihost.master[0].run_command('getent passwd -s sss')
         assert len(cmd.stdout_text) == 0
 
-    def test_no_homedir_no_slash(self, multihost):
+    def test_updated_homedir(self, multihost):
         """
-        :title: files: Test that sssd returns an empty value with no homedir
-        :id: 58010941-f1d6-453f-86f7-ade11dc81bb5
+        :title: files: Test that homedir is updated
+        :id: a9a0a911-1818-40d1-b897-0397ef107fd4
         """
         exit_status, output = get_sss_user(multihost, 'no_home_user')
         assert exit_status == 0
-        assert ":/:" not in output
+        assert ":/tmp:" in output
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to