From 69e6a78af864d92f6ac02c0fd2be92e8fc72d31e Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Wed, 4 Dec 2024 11:32:45 -0500 Subject: [PATCH] Remove stray newline --- login_duo/login_duo.c | 2 +- tests/test_login_duo.py | 10 +++++----- tests/test_pam_duo.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/login_duo/login_duo.c b/login_duo/login_duo.c index 8389fec..5f2cc87 100644 --- a/login_duo/login_duo.c +++ b/login_duo/login_duo.c @@ -142,7 +142,7 @@ do_auth(struct login_ctx *ctx, const char *cmd) config = ctx->config ? ctx->config : DUO_CONF; flags = 0; - duo_syslog(LOG_INFO, "Loading config file %s\n", config); + duo_syslog(LOG_INFO, "Loading config file %s", config); duo_config_default(&cfg); diff --git a/tests/test_login_duo.py b/tests/test_login_duo.py index 8a962bd..950b142 100755 --- a/tests/test_login_duo.py +++ b/tests/test_login_duo.py @@ -382,7 +382,7 @@ def test_connection_timeout(self): preload_script=os.path.join(TESTDIR, "login_duo.py"), timeout=10, ) - for line in result["stderr"][2:5]: + for line in result["stderr"][1:4]: self.assertEqual(line, "Attempting connection") self.assertRegexSomeline( @@ -617,8 +617,8 @@ def test_invalid_delimiter_value_whitespace(self): result = login_duo( ["-d", "-c", temp.name, "true"], ) - self.assertEqual( - result["stderr"][2], + self.assertRegexSomeline( + result["stderr"], "Invalid character option length. Character fields must be 1 character long: ''", ) self.assertRegexSomeline( @@ -635,8 +635,8 @@ def test_invalid_pos_value(self): result = login_duo( ["-d", "-c", temp.name, "true"], ) - self.assertEqual( - result["stderr"][2], + self.assertRegexSomeline( + result["stderr"], "Gecos position starts at 1", ) self.assertRegexSomeline( diff --git a/tests/test_pam_duo.py b/tests/test_pam_duo.py index 3ff80c6..65ed0ce 100755 --- a/tests/test_pam_duo.py +++ b/tests/test_pam_duo.py @@ -437,15 +437,15 @@ def test_invalid_pos_value(self): ["-d", "-c", temp.name, "true"], ) self.assertEqual( - result["stderr"][1], + result["stderr"][0], "Gecos position starts at 1", ) self.assertRegex( - result["stderr"][2], + result["stderr"][1], r"Invalid pam_duo option: 'gecos_username_pos'", ) self.assertRegex( - result["stderr"][3], + result["stderr"][2], r"Parse error in {config}, line \d+".format(config=temp.name), )