Skip to content

Commit

Permalink
hosts: client, adding /home to backup and restore
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Lavu committed Nov 27, 2024
1 parent d1492b5 commit 3ebcfc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 3 additions & 1 deletion sssd_test_framework/hosts/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def backup(self) -> Any:
backup /etc/sssd "$path/config"
backup /var/log/sssd "$path/logs"
backup /var/lib/sss "$path/lib"
backup /home "$path/home"
echo $path
""",
Expand Down Expand Up @@ -148,12 +149,13 @@ def restore(self, backup_data: Any | None) -> None:
fi
}}
rm --force --recursive /etc/sssd /var/lib/sss /var/log/sssd
rm --force --recursive /etc/sssd /var/lib/sss /var/log/sssd /home
restore "{backup_path}/krb5.conf" /etc/krb5.conf
restore "{backup_path}/krb5.keytab" /etc/krb5.keytab
restore "{backup_path}/config" /etc/sssd
restore "{backup_path}/logs" /var/log/sssd
restore "{backup_path}/lib" /var/lib/sss
restore "{backup_path}/home" /home
""",
log_level=ProcessLogLevel.Error,
)
7 changes: 1 addition & 6 deletions sssd_test_framework/utils/sssd.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,20 +899,15 @@ def autofs(self) -> None:
self.sssd.authselect.select("sssd")
self.sssd.enable_responder("autofs")

def mkhomedir(self, homedir: str = "/home") -> None:
def mkhomedir(self) -> None:
"""
Configure SSSD with mkhomedir and oddjobd.
:param homedir: Home directory path.
:type homedir: str | None, optional
#. Select authselect sssd profile with 'with-mkhomedir'
#. Start oddjobd.service
#. Backup home directory
"""
self.sssd.authselect.select("sssd", ["with-mkhomedir"])
self.sssd.svc.start("oddjobd.service")
self.sssd.fs.backup(homedir)

def proxy(
self,
Expand Down

0 comments on commit 3ebcfc1

Please sign in to comment.