Skip to content

Commit 4ff4cef

Browse files
author
Dan Lavu
committed
tests: adding misc test to resolve client hostname
1 parent 8891b61 commit 4ff4cef

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
Miscellaneous Tests
3+
"""
4+
5+
from __future__ import annotations
6+
7+
import pytest
8+
from sssd_test_framework.roles.client import Client
9+
from sssd_test_framework.topology import KnownTopology
10+
11+
12+
@pytest.mark.importance("low")
13+
@pytest.mark.ticket(jira=39537)
14+
@pytest.mark.parametrize("profile", ["local", "nis", "sssd", "winbind"])
15+
@pytest.mark.topology(KnownTopology.Client)
16+
def test_misc__default_profile_nsswitch_conf_can_resolve_client_hostname(client: Client, profile: str):
17+
"""
18+
:title: Applying authselect profiles does not break client hostname resolution
19+
:setup:
20+
1: Select and apply authselect profile
21+
:steps:
22+
1. Lookup client hostname using nslookup
23+
:expectedresults:
24+
1. Resolves the client hostname
25+
:customerscenario: True
26+
"""
27+
client.authselect.select(profile)
28+
29+
assert client.fs.exists("/etc/hostname"), "Missing /etc/hostname file!"
30+
hostname = client.fs.read("/etc/hostname")
31+
32+
assert hostname is not None, "Hostname not found!"
33+
assert client.host.conn.exec(["nslookup", hostname]).rc == 0, "Cannot resolve hostname!"

0 commit comments

Comments
 (0)