diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2022-08-17 14:26:29 +1200 |
---|---|---|
committer | Douglas Bagnall <dbagnall@samba.org> | 2022-09-06 21:12:36 +0000 |
commit | 7d178ab95bc5b7017e46041cdbe7174590e21ea9 (patch) | |
tree | 9df44d4fc78639e32ad69242f58124a40a3b0bba /source4/torture | |
parent | eefc030458674b5bb5b8338f7a3b9c1df48ad8ef (diff) | |
download | samba-7d178ab95bc5b7017e46041cdbe7174590e21ea9.tar.gz |
s4/tests/samba-tool drs showrepl: use vars for common strings
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/drs/python/samba_tool_drs_showrepl.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source4/torture/drs/python/samba_tool_drs_showrepl.py b/source4/torture/drs/python/samba_tool_drs_showrepl.py index 707b1fb3a75..89645931070 100644 --- a/source4/torture/drs/python/samba_tool_drs_showrepl.py +++ b/source4/torture/drs/python/samba_tool_drs_showrepl.py @@ -229,35 +229,39 @@ class SambaToolDrsShowReplTests(drs_base.DrsBaseTestCase): self._enable_all_repl(self.dc1) self._force_all_reps(samdb1, self.dc1, 'inbound') self._force_all_reps(samdb1, self.dc1, 'outbound') + all_good_green = "\033[1;32m[ALL GOOD]\033[0m\n" + all_good = "[ALL GOOD]\n" + try: out = self.check_output( "samba-tool drs showrepl --pull-summary %s %s" % (self.dc1, self.cmdline_creds)) out = get_string(out) - self.assertStringsEqual(out, "[ALL GOOD]\n") + self.assertStringsEqual(out, all_good) out = get_string(out) out = self.check_output("samba-tool drs showrepl --pull-summary " "--color=yes %s %s" % (self.dc1, self.cmdline_creds)) out = get_string(out) - self.assertStringsEqual(out, "\033[1;32m[ALL GOOD]\033[0m\n") + self.assertStringsEqual(out, all_good_green) # --verbose output is still quiet when all is good. out = self.check_output( "samba-tool drs showrepl --pull-summary -v %s %s" % (self.dc1, self.cmdline_creds)) out = get_string(out) - self.assertStringsEqual(out, "[ALL GOOD]\n") + self.assertStringsEqual(out, all_good) + out = self.check_output("samba-tool drs showrepl --pull-summary -v " "--color=yes %s %s" % (self.dc1, self.cmdline_creds)) out = get_string(out) + self.assertStringsEqual(out, all_good_green) except samba.tests.BlackboxProcessError as e: self.fail(str(e)) - self.assertStringsEqual(out, "\033[1;32m[ALL GOOD]\033[0m\n") def test_samba_tool_showrepl_summary_forced_failure(self): """Tests 'samba-tool drs showrepl --summary' command when we break the |