]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Revert "tests/: implement feature detection"
authorSerge Hallyn <serge@hallyn.com>
Thu, 22 May 2025 11:27:11 +0000 (06:27 -0500)
committerGitHub <noreply@github.com>
Thu, 22 May 2025 11:27:11 +0000 (06:27 -0500)
This reverts commit 8e02cff47522d046030df8c9d50be9129b50a2bd.

tests/system/framework/hosts/shadow.py

index 2a0ca3e5dde01db6cdb1d4f5bce95fa3aa69e59b..1fb656b6324ae16fb7e4c5152ac90b2126c4ed76 100644 (file)
@@ -42,9 +42,6 @@ class ShadowHost(BaseHost, BaseLinuxHost):
         ]
         """Files to verify for mismatch."""
 
-        self._features: dict[str, bool] | None = None
-        """Features supported by the host."""
-
     def pytest_setup(self) -> None:
         super().pytest_setup()
 
@@ -64,34 +61,6 @@ class ShadowHost(BaseHost, BaseLinuxHost):
         """
         raise NotImplementedError("Stopping shadow service is not implemented.")
 
-    @property
-    def features(self) -> dict[str, bool]:
-        """
-        Features supported by the host.
-        """
-        if self._features is not None:
-            return self._features
-
-        self.logger.info(f"Detecting shadow features on {self.hostname}")
-        result = self.conn.run(
-            """
-            set -ex
-
-            getent gshadow > /dev/null 2>&1 && echo "gshadow" || :
-            """,
-            log_level=ProcessLogLevel.Error,
-        )
-
-        # Set default values
-        self._features = {
-            "gshadow": False,
-        }
-
-        self._features.update({k: True for k in result.stdout_lines})
-        self.logger.info("Detected features:", extra={"data": {"Features": self._features}})
-
-        return self._features
-
     def backup(self) -> Any:
         """
         Backup all shadow data.