URL: https://github.com/freeipa/freeipa/pull/208
Author: mirielka
 Title: #208: Tests: Fix integration sudo test
Action: opened

PR body:
"""
Tests with sudorules using only RunAsGroups attributes with empty RunAsUsers
attribute fail due to different expected value than is really returned. This is
caused by improper behaviour of sudo in versions before 1.8.18 (see [1]), to
which the tests were originally fitted. Changing the expected value to proper
one.

[1] - https://www.sudo.ws/pipermail/sudo-workers/2016-November/001025.html

https://fedorahosted.org/freeipa/ticket/6378

Please note that this PR needs to go to master, ipa-4-4 AND ipa-4-3 branches 
(ticket milestone is to be updated).
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/208/head:pr208
git checkout pr208
From c67887803e221a3916fdfa9cb779f0363ee02670 Mon Sep 17 00:00:00 2001
From: Lenka Doudova <ldoud...@redhat.com>
Date: Wed, 5 Oct 2016 14:25:01 +0200
Subject: [PATCH] Tests: Fix integration sudo test

Tests with sudorules using only RunAsGroups attributes with empty RunAsUsers
attribute fail due to different expected value than is really returned. This is
caused by improper behaviour of sudo in versions before 1.8.18 (see [1]), to
which the tests were originally fitted. Changing the expected value to proper
one.

[1] - https://www.sudo.ws/pipermail/sudo-workers/2016-November/001025.html

https://fedorahosted.org/freeipa/ticket/6378
---
 ipatests/test_integration/test_sudo.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipatests/test_integration/test_sudo.py b/ipatests/test_integration/test_sudo.py
index a1676a2..1fbdee3 100644
--- a/ipatests/test_integration/test_sudo.py
+++ b/ipatests/test_integration/test_sudo.py
@@ -530,7 +530,7 @@ def test_sudo_rule_restricted_to_running_as_single_group_setup(self):
 
     def test_sudo_rule_restricted_to_running_as_single_group(self):
         result1 = self.list_sudo_commands("testuser1", verbose=True)
-        assert "RunAsUsers: root" in result1.stdout_text
+        assert "RunAsUsers: testuser1" in result1.stdout_text
         assert "RunAsGroups: testgroup2" in result1.stdout_text
 
     def test_setting_category_to_all_with_valid_entries_runasgroup(self):
@@ -551,7 +551,7 @@ def test_sudo_rule_restricted_to_running_as_single_local_group_setup(self):
 
     def test_sudo_rule_restricted_to_running_as_single_local_group(self):
         result1 = self.list_sudo_commands("testuser1", verbose=True)
-        assert "RunAsUsers: root" in result1.stdout_text
+        assert "RunAsUsers: testuser1" in result1.stdout_text
         assert "RunAsGroups: localgroup" in result1.stdout_text
 
     def test_setting_category_to_all_with_valid_entries_runasgroup_local(self):
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to