Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autofs imagemode #7829

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/tests/system/mhc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ domains:
bindpw: Secret123
client:
ldap_tls_reqcert: demand
ldap_tls_cacert: /data/certs/ca.crt
ldap_tls_cacert: /var/data/certs/ca.crt
dns_discovery_domain: ldap.test

- hostname: master.ipa.test
role: ipa
config:
client:
ipa_domain: ipa.test
krb5_keytab: /enrollment/ipa.test.keytab
ldap_krb5_keytab: /enrollment/ipa.test.keytab
krb5_keytab: /var/enrollment/ipa.test.keytab
ldap_krb5_keytab: /var/enrollment/ipa.test.keytab

- hostname: dc.ad.test
role: ad
Expand All @@ -52,8 +52,8 @@ domains:
bindpw: Secret123
client:
ad_domain: samba.test
krb5_keytab: /enrollment/samba.test.keytab
ldap_krb5_keytab: /enrollment/samba.test.keytab
krb5_keytab: /var/enrollment/samba.test.keytab
ldap_krb5_keytab: /var/enrollment/samba.test.keytab

- hostname: nfs.test
role: nfs
Expand Down
20 changes: 10 additions & 10 deletions src/tests/system/tests/test_autofs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ def test_autofs__cache_first_set_to_true(
1. Create NFS export
2. Create auto.master map
3. Create auto.export map
4. Add /export (auto.export) key to auto.master
4. Add /var/export (auto.export) key to auto.master
5. Add "NFS export" key as "export" to auto.export
6. Enable autofs responder
7. Set [autofs]/cache_first = $cache_first
8. Start SSSD
9. Reload autofs daemon
:steps:
1. Access /export/export
1. Access /var/export/export
2. Dump automount maps "automount -m"
:expectedresults:
1. Directory can be accessed and it is correctly mounted to the NFS share
2. /export contains auto.export map and "export" key
2. /var/export contains auto.export map and "export" key
:customerscenario: False
"""
nfs_export = nfs.export("export").add()
Expand All @@ -60,7 +60,7 @@ def test_autofs__cache_first_set_to_true(
client.automount.reload()

# Check that we can mount the exported directory
assert client.automount.mount("/export/export", nfs_export), "Unable to mount /export/export!"
assert client.automount.mount("/var/export/export", nfs_export), "Unable to mount /var/export/export!"

# Check that the maps are correctly fetched
assert client.automount.dumpmaps() == {
Expand Down Expand Up @@ -163,26 +163,26 @@ def test_autofs__works_with_some_offline_domains(client: Client, nfs: NFS, provi
1. Create NFS export
2. Create auto.master map
3. Create auto.export map
4. Add /export (auto.export) key to auto.master
4. Add /var/export (auto.export) key to auto.master
5. Add "NFS export" key as "export" to auto.export
6. Create two fake LDAP domains that will be offline (the provider is online)
7. Enable autofs responder
8. Start SSSD
9. Reload autofs daemon
:steps:
1. Access /export/export
1. Access /var/export/export
2. Dump automount maps "automount -m"
:expectedresults:
1. Directory can be accessed and it is correctly mounted to the NFS share
2. /export contains auto.export map and "export" key
2. /var/export contains auto.export map and "export" key
:customerscenario: False
"""

# Create autofs maps
nfs_export = nfs.export("export").add()
auto_master = provider.automount.map("auto.master").add()
auto_export = provider.automount.map("auto.export").add()
auto_master.key("/export").add(info=auto_export)
auto_master.key("/var/export").add(info=auto_export)
key = auto_export.key("export").add(info=nfs_export)

# Create fake domains, these will be offline
Expand All @@ -207,9 +207,9 @@ def test_autofs__works_with_some_offline_domains(client: Client, nfs: NFS, provi
client.automount.reload()

# Check that we can mount the exported directory
assert client.automount.mount("/export/export", nfs_export), "Unable to mount /export/export!"
assert client.automount.mount("/var/export/export", nfs_export), "Unable to mount /var/export/export!"

# Check that the maps are correctly fetched
assert client.automount.dumpmaps() == {
"/export": {"map": "auto.export", "keys": [str(key)]},
"/var/export": {"map": "auto.export", "keys": [str(key)]},
}, "Automount maps do not match!"
Loading