[SSSD] [sssd PR#5913][comment] Analyzer: Remove python-click dependency

2021-12-14 Thread thalman
  URL: https://github.com/SSSD/sssd/pull/5913
Title: #5913: Analyzer: Remove python-click dependency

thalman commented:
"""
ACK
"""

See the full comment at 
https://github.com/SSSD/sssd/pull/5913#issuecomment-993686327
___
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[SSSD] [sssd PR#5913][+Accepted] Analyzer: Remove python-click dependency

2021-12-14 Thread thalman
  URL: https://github.com/SSSD/sssd/pull/5913
Title: #5913: Analyzer: Remove python-click dependency

Label: +Accepted
___
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[SSSD] [sssd PR#5913][comment] Analyzer: Remove python-click dependency

2021-12-14 Thread thalman
  URL: https://github.com/SSSD/sssd/pull/5913
Title: #5913: Analyzer: Remove python-click dependency

thalman commented:
"""
Thank you for the patch. I will wait for CI to finish the job and then I'm 
going to ACK it.
"""

See the full comment at 
https://github.com/SSSD/sssd/pull/5913#issuecomment-993567005
___
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[SSSD] [sssd PR#5913][synchronized] Analyzer: Remove python-click dependency

2021-12-14 Thread justin-stephenson
   URL: https://github.com/SSSD/sssd/pull/5913
Author: justin-stephenson
 Title: #5913: Analyzer: Remove python-click dependency
Action: synchronized

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/5913/head:pr5913
git checkout pr5913
From 5e59fa992e15e2e9913e26bbce12c0d102eb162e Mon Sep 17 00:00:00 2001
From: Justin Stephenson 
Date: Tue, 7 Dec 2021 10:21:36 -0500
Subject: [PATCH] Analyzer: Remove python-click dependency

As python-click will not be in RHEL9, switch to using the builtin
argparse python module.
---
 contrib/sssd.spec.in  |   3 +-
 src/tools/analyzer/modules/request.py | 129 +++-
 src/tools/analyzer/sss_analyze.py | 166 +++---
 3 files changed, 226 insertions(+), 72 deletions(-)

diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
index 015cd6b8ff..5cb9726a4d 100644
--- a/contrib/sssd.spec.in
+++ b/contrib/sssd.spec.in
@@ -221,9 +221,8 @@ Requires: sssd-common = %{version}-%{release}
 Requires: python3-sss = %{version}-%{release}
 Requires: python3-sssdconfig = %{version}-%{release}
 Requires: libsss_certmap = %{version}-%{release}
-# required by sss_analyze
+# for logger=journald support with sss_analyze
 Requires: python3-systemd
-Requires: python3-click
 Requires: sssd-dbus
 
 %description tools
diff --git a/src/tools/analyzer/modules/request.py b/src/tools/analyzer/modules/request.py
index 098a9197bb..ff9592e308 100644
--- a/src/tools/analyzer/modules/request.py
+++ b/src/tools/analyzer/modules/request.py
@@ -1,67 +1,91 @@
 import re
 import copy
-import click
 import logging
+import argparse
 
 from enum import Enum
 from source_files import Files
 from source_journald import Journald
+from sss_analyze import SubparsersAction
+from sss_analyze import Option
+from sss_analyze import Analyzer
 
 logger = logging.getLogger()
 
 
-@click.group(help="Request module")
-def request():
-pass
-
-
-@request.command()
-@click.option("-v", "--verbose", is_flag=True, help="Enables verbose output")
-@click.option("--pam", is_flag=True, help="Filter only PAM requests")
-@click.pass_obj
-def list(ctx, verbose, pam):
-analyzer = RequestAnalyzer()
-source = analyzer.load(ctx)
-analyzer.list_requests(source, verbose, pam)
-
-
-@request.command()
-@click.argument("cid", nargs=1, type=int, required=True)
-@click.option("--merge", is_flag=True, help="Merge logs together sorted"
-  " by timestamp (requires debug_microseconds = True)")
-@click.option("--cachereq", is_flag=True, help="Include cache request "
-  "related logs")
-@click.option("--pam", is_flag=True, help="Track only PAM requests")
-@click.pass_obj
-def show(ctx, cid, merge, cachereq, pam):
-analyzer = RequestAnalyzer()
-source = analyzer.load(ctx)
-analyzer.track_request(source, cid, merge, cachereq, pam)
-
-
 class RequestAnalyzer:
 """
 A request analyzer module, handles request tracking logic
 and analysis. Parses input generated from a source Reader.
 """
+module_parser = None
 consumed_logs = []
 done = ""
+list_opts = [
+Option('--verbose', 'Verbose output', bool, '-v'),
+Option('--pam', 'Filter only PAM requests', bool),
+]
+
+show_opts = [
+Option('cid', 'Track request with this ID', int),
+Option('--cachereq', 'Include cache request logs', bool),
+Option('--merge', 'Merge logs together sorted by timestamp', bool),
+Option('--pam', 'Track only PAM requests', bool),
+]
+
+def print_module_help(self, args):
+"""
+Print the module parser help output
+
+Args:
+args (Namespace): argparse parsed arguments
+"""
+self.module_parser.print_help()
+
+def setup_args(self, parser_grp):
+"""
+Setup module parser, subcommands, and options
 
-def load(self, ctx):
+Args:
+parser_grp (argparse.Action): Parser group to nest
+   module and subcommands under
+"""
+desc = "Analyze request tracking module"
+self.module_parser = parser_grp.add_parser('request',
+   description=desc,
+   help='Request tracking')
+
+subparser = self.module_parser.add_subparsers(title=None,
+  dest='subparser',
+  action=SubparsersAction,
+  metavar='COMMANDS')
+
+cli = Analyzer()
+subcmd_grp = subparser.add_parser_group('Operation Modes')
+cli.add_subcommand(subcmd_grp, 'list', 'List recent requests',
+   self.list_requests, self.list_opts)
+cli.add_subcommand(subcmd_grp, 'show', 'Track individual request ID',
+   

[SSSD] [sssd PR#5845][comment] sss-analyze: Fix self imports

2021-12-14 Thread stanislavlevin
  URL: https://github.com/SSSD/sssd/pull/5845
Title: #5845: sss-analyze: Fix self imports

stanislavlevin commented:
"""
@justin-stephenson, thank you for your patience :)
"""

See the full comment at 
https://github.com/SSSD/sssd/pull/5845#issuecomment-993536678
___
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[SSSD] [sssd PR#5845][comment] sss-analyze: Fix self imports

2021-12-14 Thread justin-stephenson
  URL: https://github.com/SSSD/sssd/pull/5845
Title: #5845: sss-analyze: Fix self imports

justin-stephenson commented:
"""
> @justin-stephenson, `sss_analyze.py` is the module lived in site-packages, 
> while `sss_analyze` is just a wrapper over that module. Do you want to 
> completely drop `sss_analyze.py` module?

I see now the addition of the new wrapper, let's leave as is for now. Ack to 
these changes.
"""

See the full comment at 
https://github.com/SSSD/sssd/pull/5845#issuecomment-993530470
___
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[SSSD] [sssd PR#5894][comment] contrib: sssd krb5 configuration snippet

2021-12-14 Thread thalman
  URL: https://github.com/SSSD/sssd/pull/5894
Title: #5894: contrib: sssd krb5 configuration snippet

thalman commented:
"""
LGTM, thank you for the patch
"""

See the full comment at 
https://github.com/SSSD/sssd/pull/5894#issuecomment-993514670
___
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[SSSD] [sssd PR#5894][-Waiting for review] contrib: sssd krb5 configuration snippet

2021-12-14 Thread thalman
  URL: https://github.com/SSSD/sssd/pull/5894
Title: #5894: contrib: sssd krb5 configuration snippet

Label: -Waiting for review
___
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[SSSD] [sssd PR#5894][+Accepted] contrib: sssd krb5 configuration snippet

2021-12-14 Thread thalman
  URL: https://github.com/SSSD/sssd/pull/5894
Title: #5894: contrib: sssd krb5 configuration snippet

Label: +Accepted
___
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[SSSD] [sssd PR#5869][synchronized] Translations update from Weblate

2021-12-14 Thread weblate
   URL: https://github.com/SSSD/sssd/pull/5869
Author: weblate
 Title: #5869: Translations update from Weblate
Action: synchronized

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/5869/head:pr5869
git checkout pr5869
From 2b4ca47815b36b21822737501f43482910ab101f Mon Sep 17 00:00:00 2001
From: Weblate 
Date: Fri, 3 Dec 2021 23:16:08 +0100
Subject: [PATCH] po: update translations

(Czech) currently translated at 5.7% (151 of 2621 strings)
Translation: SSSD/sssd-manpage
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-manpage-master/cs/

po: update translations

(Czech) currently translated at 100.0% (619 of 619 strings)
Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/cs/

po: update translations

(Chinese (Simplified) (zh_CN)) currently translated at 99.3% (615 of 619 strings)
Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/zh_CN/

po: update translations

(Spanish) currently translated at 100.0% (619 of 619 strings)
Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/es/

po: update translations

(Korean) currently translated at 13.8% (362 of 2615 strings)
Translation: SSSD/sssd-manpage
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-manpage-master/ko/

po: update translations

(Spanish) currently translated at 96.9% (600 of 619 strings)
Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/es/

po: update translations

(Korean) currently translated at 13.3% (349 of 2615 strings)
Translation: SSSD/sssd-manpage
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-manpage-master/ko/

po: update translations

(Ukrainian) currently translated at 100.0% (619 of 619 strings)
Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/uk/

po: update translations

(Polish) currently translated at 100.0% (619 of 619 strings)
Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/pl/

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/

po: update translations

(Korean) currently translated at 13.0% (341 of 2615 strings)
Translation: SSSD/sssd-manpage
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-manpage-master/ko/

po: update translations

(Korean) currently translated at 30.7% (190 of 617 strings)
Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/ko/
---
 po/cs.po | 236 ---
 po/es.po | 138 +++
 po/ko.po |   1 +
 po/pl.po |  10 +-
 po/uk.po |  10 +-
 po/zh_CN.po  |  16 ++--
 src/man/po/cs.po |  95 ---
 src/man/po/ko.po |  66 +++--
 8 files changed, 362 insertions(+), 210 deletions(-)

diff --git a/po/cs.po b/po/cs.po
index eda8eecb3f..df6910c99e 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -7,16 +7,16 @@ msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: sssd-devel@lists.fedorahosted.org\n"
 "POT-Creation-Date: 2021-11-09 16:03+0100\n"
-"PO-Revision-Date: 2021-09-23 13:04+\n"
+"PO-Revision-Date: 2021-12-03 22:16+\n"
 "Last-Translator: Pavel Borecki \n"
-"Language-Team: Czech \n"
+"Language-Team: Czech \n"
 "Language: cs\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
-"X-Generator: Weblate 4.8\n"
+"X-Generator: Weblate 4.9.1\n"
 
 #: src/config/SSSDConfig/sssdoptions.py:20
 #: src/config/SSSDConfig/sssdoptions.py:21
@@ -72,12 +72,18 @@ msgid ""
 "is in seconds and calculated by the following: offline_timeout + "
 "random_offset."
 msgstr ""
+"Když se SSSD přepne do režimu bez připojení, doba po které se pak pokouší "
+"znovu připojit se zvýší v závislosti na době strávené bez připojení. Tato "
+"hodnota je v sekundách a je vypočítávána takto: offilne_timeout (časový "
+"limit pro bez připojení + random_offset (náhodný posun)."
 
 #: src/config/SSSDConfig/sssdoptions.py:38
 msgid ""
 "Indicates what is the syntax of the config file. SSSD 0.6.0 and later use "
 "version 2."
 msgstr ""
+"Značí jaká je syntaxe souboru s nastaveními. SSSD 0.6.0 a novější používají "
+"verzi 2."
 
 #: src/config/SSSDConfig/sssdoptions.py:39
 msgid "SSSD Services to start"
@@ -127,7 +133,7 @@ msgstr "Vyladit sssd aby respektovalo nebo ignorovalo změny stavu netlink"
 
 #: 

[SSSD] [sssd PR#5869][synchronized] Translations update from Weblate

2021-12-14 Thread weblate
   URL: https://github.com/SSSD/sssd/pull/5869
Author: weblate
 Title: #5869: Translations update from Weblate
Action: synchronized

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/5869/head:pr5869
git checkout pr5869
From 84d7ac294331d4071335c77c071e054bfe4d4c39 Mon Sep 17 00:00:00 2001
From: Weblate 
Date: Fri, 3 Dec 2021 23:16:08 +0100
Subject: [PATCH] po: update translations

(Czech) currently translated at 5.7% (151 of 2621 strings)
Translation: SSSD/sssd-manpage
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-manpage-master/cs/

po: update translations

(Czech) currently translated at 100.0% (619 of 619 strings)
Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/cs/

po: update translations

(Chinese (Simplified) (zh_CN)) currently translated at 99.3% (615 of 619 strings)
Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/zh_CN/

po: update translations

(Spanish) currently translated at 100.0% (619 of 619 strings)
Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/es/

po: update translations

(Korean) currently translated at 13.8% (362 of 2615 strings)
Translation: SSSD/sssd-manpage
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-manpage-master/ko/

po: update translations

(Spanish) currently translated at 96.9% (600 of 619 strings)
Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/es/

po: update translations

(Korean) currently translated at 13.3% (349 of 2615 strings)
Translation: SSSD/sssd-manpage
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-manpage-master/ko/

po: update translations

(Ukrainian) currently translated at 100.0% (619 of 619 strings)
Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/uk/

po: update translations

(Polish) currently translated at 100.0% (619 of 619 strings)
Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/pl/

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/

po: update translations

(Korean) currently translated at 13.0% (341 of 2615 strings)
Translation: SSSD/sssd-manpage
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-manpage-master/ko/

po: update translations

(Korean) currently translated at 30.7% (190 of 617 strings)
Translation: SSSD/sssd
Translate-URL: https://translate.fedoraproject.org/projects/sssd/sssd-master/ko/
---
 po/cs.po | 236 ---
 po/es.po | 138 +++
 po/ko.po |   1 +
 po/pl.po |  10 +-
 po/uk.po |  10 +-
 po/zh_CN.po  |  16 ++--
 src/man/po/cs.po |  95 ---
 src/man/po/ko.po |  66 +++--
 8 files changed, 362 insertions(+), 210 deletions(-)

diff --git a/po/cs.po b/po/cs.po
index eda8eecb3f..df6910c99e 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -7,16 +7,16 @@ msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: sssd-devel@lists.fedorahosted.org\n"
 "POT-Creation-Date: 2021-11-09 16:03+0100\n"
-"PO-Revision-Date: 2021-09-23 13:04+\n"
+"PO-Revision-Date: 2021-12-03 22:16+\n"
 "Last-Translator: Pavel Borecki \n"
-"Language-Team: Czech \n"
+"Language-Team: Czech \n"
 "Language: cs\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
-"X-Generator: Weblate 4.8\n"
+"X-Generator: Weblate 4.9.1\n"
 
 #: src/config/SSSDConfig/sssdoptions.py:20
 #: src/config/SSSDConfig/sssdoptions.py:21
@@ -72,12 +72,18 @@ msgid ""
 "is in seconds and calculated by the following: offline_timeout + "
 "random_offset."
 msgstr ""
+"Když se SSSD přepne do režimu bez připojení, doba po které se pak pokouší "
+"znovu připojit se zvýší v závislosti na době strávené bez připojení. Tato "
+"hodnota je v sekundách a je vypočítávána takto: offilne_timeout (časový "
+"limit pro bez připojení + random_offset (náhodný posun)."
 
 #: src/config/SSSDConfig/sssdoptions.py:38
 msgid ""
 "Indicates what is the syntax of the config file. SSSD 0.6.0 and later use "
 "version 2."
 msgstr ""
+"Značí jaká je syntaxe souboru s nastaveními. SSSD 0.6.0 a novější používají "
+"verzi 2."
 
 #: src/config/SSSDConfig/sssdoptions.py:39
 msgid "SSSD Services to start"
@@ -127,7 +133,7 @@ msgstr "Vyladit sssd aby respektovalo nebo ignorovalo změny stavu netlink"
 
 #: 

[SSSD] [sssd PR#5845][comment] sss-analyze: Fix self imports

2021-12-14 Thread stanislavlevin
  URL: https://github.com/SSSD/sssd/pull/5845
Title: #5845: sss-analyze: Fix self imports

stanislavlevin commented:
"""
@justin-stephenson, `sss_analyze.py` is the module lived in site-packages, 
while `sss_analyze` is just a wrapper over that module.
Do you want to completely drop `sss_analyze.py` module?
"""

See the full comment at 
https://github.com/SSSD/sssd/pull/5845#issuecomment-993374522
___
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


[SSSD] [sssd PR#5892][synchronized] Tests: Add a test for BZ2004406

2021-12-14 Thread jakub-vavra-cz
   URL: https://github.com/SSSD/sssd/pull/5892
Author: jakub-vavra-cz
 Title: #5892: Tests: Add a test for BZ2004406
Action: synchronized

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/5892/head:pr5892
git checkout pr5892
From 56956b864e1709dd308bbfcad85b9568a88af93e Mon Sep 17 00:00:00 2001
From: Jakub Vavra 
Date: Fri, 26 Nov 2021 07:24:15 +0100
Subject: [PATCH] Tests: Add a test for BZ2004406

Bugzilla:
  https://bugzilla.redhat.com/show_bug.cgi?id=2004406
  https://bugzilla.redhat.com/show_bug.cgi?id=2031729
Verifies: MR#5791
---
 src/tests/multihost/ipa/test_adtrust.py | 87 +
 1 file changed, 87 insertions(+)

diff --git a/src/tests/multihost/ipa/test_adtrust.py b/src/tests/multihost/ipa/test_adtrust.py
index 3f2fc66c1b..57b97e1ce6 100644
--- a/src/tests/multihost/ipa/test_adtrust.py
+++ b/src/tests/multihost/ipa/test_adtrust.py
@@ -6,12 +6,14 @@
 :upstream: yes
 """
 
+import random
 import re
 import time
 import pytest
 import paramiko
 from sssd.testlib.common.utils import sssdTools
 from sssd.testlib.common.utils import SSHClient
+from sssd.testlib.common.utils import ADOperations
 
 
 @pytest.mark.usefixtures('setup_ipa_client')
@@ -379,3 +381,88 @@ def test_nss_get_by_name_with_private_group(self, multihost):
 assert cmd_adm.returncode == 0, 'Something wrong with setup!'
 assert cmd_usr.returncode == 0, \
 f"pysss_nss_idmap.getsidbyname for {username} failed"
+
+@staticmethod
+def test_idview_override_group_custom(multihost, create_aduser_group):
+"""
+:title: IPA clients fail to resolve override group names in custom view
+:id: 7a0dc871-fdad-4c07-9d07-a092baa83178
+:bugzilla:
+  https://bugzilla.redhat.com/show_bug.cgi?id=2004406
+  https://bugzilla.redhat.com/show_bug.cgi?id=2031729
+:description: Overriding both user and group names and ids in
+  an idview for user and group from AD results in error in sssd
+  when running id command.
+:setup:
+ 1. Create user and group (group1) on AD.
+ 2. Make AD user member of group1.
+ 2. Create additional group (group2) on AD.
+:steps:
+ 1. ID views to override AD groupname and gid of group1.
+ 2. ID views to override AD groupname and gid of group2.
+ 3. ID view to override AD username, uid and gid (to gid of group2).
+ 4. Run an "id" command for the override user.
+ client
+:expectedresults:
+  1. View with an override is created.
+  2. View with an override is created.
+  3. User override is added to the view.
+  4. Id command succeeds, group override is visible, all groups are
+  properly resolved.
+"""
+(aduser, adgroup) = create_aduser_group
+run_id_int = random.randint(, 99)
+adgroup2 = f"group2_{run_id_int}"
+ado = ADOperations(multihost.ad[0])
+ado.create_ad_unix_group(adgroup2)
+domain = multihost.ad[0].domainname
+
+ipa_client = sssdTools(multihost.client[0])
+ipa_client.clear_sssd_cache()
+
+view = f'prygl_trust_view_{run_id_int}'
+create_view = f'ipa idview-add {view}'
+multihost.master[0].run_command(create_view, raiseonerr=False)
+
+create_grp_override = f'ipa idoverridegroup-add "{view}" ' \
+f'{adgroup}@{domain} --group-name ' \
+f'"borci{run_id_int}" --gid={run_id_int+1}'
+multihost.master[0].run_command(create_grp_override, raiseonerr=False)
+
+create_grp2_override = f'ipa idoverridegroup-add "{view}" ' \
+f'{adgroup2}@{domain} --group-name ' \
+f'"magori{run_id_int}" --gid={run_id_int+2}'
+multihost.master[0].run_command(create_grp2_override, raiseonerr=False)
+
+create_user_override = f'ipa idoverrideuser-add "{view}" ' \
+f'{aduser}@{domain} --login ferko{run_id_int} ' \
+f'--uid=50001 --gidnumber={run_id_int+2}'
+multihost.master[0].run_command(create_user_override, raiseonerr=False)
+
+# Apply the view on client
+multihost.master[0].run_command(
+f"ipa idview-apply '{view}' --hosts="
+f"{multihost.client[0].sys_hostname}", raiseonerr=False)
+
+ipa_client.clear_sssd_cache()
+time.sleep(5)
+cmd = multihost.client[0].run_command(
+f'id ferko{run_id_int}@{domain}', raiseonerr=False)
+
+# TEARDOWN
+ado.delete_ad_user_group(adgroup2)
+multihost.master[0].run_command(
+f'ipa idview-del {view}', raiseonerr=False)
+
+# Test result Evaluation
+assert cmd.returncode == 0, f"User {aduser} was not found."
+assert f"borci{run_id_int}@{domain}" in cmd.stdout_text,\
+f"Group 1 {adgroup} name was not overridden/resolved."
+assert f"magori{run_id_int}@{domain}" in