Skip to content

Commit

Permalink
ALT: ipatests: Don't install langpacks-en
Browse files Browse the repository at this point in the history
There is no langpacks in ALTLinux.

Fixes:
```
==================================== ERRORS ====================================
____________ ERROR at setup of TestPWPolicy.test_krbtpolicy_default ____________

cls = <class 'ipatests.test_integration.test_krbtpolicy.TestPWPolicy'>
mh = <pytest_multihost.plugin.MultihostFixture object at 0x7f6688375bd0>

    @classmethod
    def install(cls, mh):
>       tasks.install_packages(cls.master, LANG_PKG)

test_integration/test_krbtpolicy.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pytest_ipa/integration/tasks.py:2595: in install_packages
    host.run_command(install_cmd + pkgs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <ipatests.pytest_ipa.integration.host.Host master1.ipa.test (master)>
argv = ['apt-get', 'install', '-y', 'langpacks-en'], set_env = True
stdin_text = None, log_stdout = True, raiseonerr = True, cwd = None, bg = False
encoding = 'utf-8', ok_returncode = 0

    def run_command(self, argv, set_env=True, stdin_text=None,
                    log_stdout=True, raiseonerr=True,
                    cwd=None, bg=False, encoding='utf-8', ok_returncode=0):
        """Wrapper around run_command to log stderr on raiseonerr=True

        :param ok_returncode: return code considered to be correct,
                              you can pass an integer or sequence of integers
        """
        result = super().run_command(
            argv, set_env=set_env, stdin_text=stdin_text,
            log_stdout=log_stdout, raiseonerr=False, cwd=cwd, bg=bg,
            encoding=encoding
        )
        # in FIPS mode SSH may print noise to stderr, remove the string
        # "FIPS mode initialized" + optional newline.
        result.stderr_bytes = FIPS_NOISE_RE.sub(b'', result.stderr_bytes)
        try:
            result_ok = result.returncode in ok_returncode
        except TypeError:
            result_ok = result.returncode == ok_returncode
        if not result_ok and raiseonerr:
            result.log.error('stderr: %s', result.stderr_text)
>           raise subprocess.CalledProcessError(
                result.returncode, argv,
                result.stdout_text, result.stderr_text
            )
E           subprocess.CalledProcessError: Command '['apt-get', 'install', '-y', 'langpacks-en']' returned non-zero exit status 100.

pytest_ipa/integration/host.py:202: CalledProcessError
---------------------------- Captured stderr setup -----------------------------
ipa: ERROR: stderr: E: Couldn't find package langpacks-en

```
  • Loading branch information
stanislavlevin committed Dec 25, 2023
1 parent 4c212e8 commit 1584302
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ipatests/test_integration/test_krbtpolicy.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ class TestPWPolicy(IntegrationTest):

@classmethod
def install(cls, mh):
tasks.install_packages(cls.master, LANG_PKG)
platform = tasks.get_platform(cls.master)
if platform not in ["altlinux"]:
tasks.install_packages(cls.master, LANG_PKG)
tasks.install_master(cls.master)
tasks.create_active_user(cls.master, USER1, PASSWORD)
tasks.create_active_user(cls.master, USER2, PASSWORD)
Expand Down

0 comments on commit 1584302

Please sign in to comment.