summaryrefslogtreecommitdiff
path: root/python
Commit message (Collapse)AuthorAgeFilesLines
* tests: Add SMB Py binding .deltree test caseTim Beale2018-12-121-2/+60
| | | | | | | | | | | | | | | | Add a more thorough test case that .deltree works as expected. Note that we get a slightly different NT_STATUS error in file_exists() if the parent directory doesn't exist, e.g. /non-existent-dir/nonexistent.txt BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Dec 12 08:23:07 CET 2018 on sn-devel-144
* tests: Extend SMB test_save_load_text case to check overwriteTim Beale2018-12-121-0/+7
| | | | | | | | | | | | | | Extend the test case to check overwriting a file as well. Currently this has the behaviour of appending to the existing file, rather than overwriting the file with new contents. It's not clear from the API that this is the intended behaviour in this case, so I've marked it as a failure. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests: Extend SMB Py binding .list() test-caseTim Beale2018-12-121-0/+22
| | | | | | | | | | Extend the tests to better reflect some of the .list() functionality we expect. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests: Fix SMB Py binding .unlink() test case assertionTim Beale2018-12-121-1/+20
| | | | | | | | | | | | | | | The current assertion would never detect if the unlink API is broken. The chkpath() API is only useful for checking if directories exist, so it will always return False for a regular file (regardless of whether the file actually exists or not). Rework the test case so we assert that the file exists by trying to read its contents (which will throw an error if the file doesn't exist). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests: Add SMB Py binding .chkpath() test caseTim Beale2018-12-121-0/+24
| | | | | | | | | | | chkpath was only tested incidentally (and that assertion was wrong). Add a proper test to prove it works correctly. We can then clean-up the incorrect assertion in the next patch. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* various: Remove references to about to be deleted thirdparty/dnspythonNoel Power2018-12-111-1/+0
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba: PY3 port samba.tests.samba_tool.visualize_drsNoel Power2018-12-102-6/+10
| | | | | | | | | | * Fix calling samba-tool with correct PYTHON version * Fix integer division needs '//' operator (this was causing 'uncaught exception - list indices must be integers or slices, not float' Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba/netcmd: PY3 port for samba4.drs.samba_tool_drs_showreplNoel Power2018-12-101-10/+10
| | | | | | | | Fix various ldb.bytes that need to be stringified in order to get tests to pass Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba/blackbox: PY3 port for samba.tests.blackbox.traffic_learnerNoel Power2018-12-101-3/+22
| | | | | | | | | | | | The order of the values in the TrafficModel is different, but... also unfortunately output of json.dump is also different (even when using sorted versions of the associated dictionaries before dumping), these changes reimport the output files into TrafficModel objects rather than comparing the actual raw files. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba/tests: PY3 make sure traffic_learner is called with correct pythonNoel Power2018-12-101-3/+8
| | | | | | | | Also path to traffic_learner is not in the normal 'bin' path so also adjusted the insertion of PYTHON version to cover this Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba/test: Make sure traffic_replay is called with correct pythonNoel Power2018-12-101-1/+1
| | | | | | | PY3 fix samba4.blackbox.rfc2307_mapping Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba/tests: Fix auth_log messaging problems in py3Noel Power2018-12-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some tests (especially samba.tests.auth_log_netlogon_bad_creds) are failing due to not receiving expected messages. There seems to be some timing issue or race around the messaging bus being set up and getting the expected events resulting from the failed netlogon. Specifically the the order of destruction of the messaging.Messaging() c-py objects is different under python2. Under python2 all of the messaging.Messaging() objects are destructed *after* all the tests are run. Note: each instance of the TestCase has it's own Messaging() instance which is created by TestCaseXYZ.setUp, so it appears the unittest destroys the test instances when all the tests have run whereas in python3 we see each messaging.Messaging() instance destroyed after each test runs. Ok, what difference does that make ? well it seems in python3 because each Messaging() instance is destructed after a test runs that the associated messaging_dgm_destroy() also runs, this destroys the global_dgm_context context which means when the next test runs the whole messaging infrastructure needs to be built again when the next Messaging() object is created. On the server-side this seems to result in attempts to send messages to the listener failing first with get_event_server: Failed to find 'auth_event' registered on the message bus to send JSON audit events to: NT_STATUS_CONNECTION_REFUSED and subsequently with get_event_server: Failed to find 'auth_event' registered on the message bus to send JSON audit events to: NT_STATUS_UNSUCCESSFUL client doesn't get any more messages, test fails :-( So, what's the difference in python2, well because the destructors for the (4 in the case of netlogon_bad_creds) instances of Messagaging() don't run till the end of the tests this doesn't happen and the global_dgm_context never gets destroyed untill all the tests complete. There is some race condition at play here, a simple sleep at the start of a failing test fixes the problem. But... ok that isn't a possible solution here, instead I have adjusted the base auth tests to store the Messaging() objects in a global list forcing them to remain in scope until the tests are complete. This ensure the behaviour is consistent across python2 & python3. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba/tests: PY3 port failing samba.tests.auth_log_samlogon.pyNoel Power2018-12-101-3/+2
| | | | | | | | Make sure correctly encode password to utf16 and not use unicode (which doesn't exist in PY3) Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba/tests: PY3 port failing samba.tests.auth_log_netlogonNoel Power2018-12-101-3/+2
| | | | | | | Fix password encoding Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba: PY3 fix failing py3 samba.tests.group_audit testNoel Power2018-12-101-3/+3
| | | | | | | Fix bytes being compared against ldb.bytes Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba/kcc: PY3 fix some str versus ldb.bytes comparisonsNoel Power2018-12-101-3/+3
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba: PY3 don't call str for bytes (or str)Noel Power2018-12-101-4/+9
| | | | | | | | | | | | | | | | | | | | | | | Note: Fix needed also for gpo.apply minPwdAge, maxPwdAge, minPwdLength & set_pwdProperties all have a line like value = str(value).encode('utf8') this is a generic type statement I guess to convert int, float etc to utf8 encoded bytes representing the string value for those. This worked fine in PY2 but in py3 some routine already are passing bytes into these methods, in these cases e.g. b'200' will get converted to "b'200'", this change only performs the conversion above for non bytes (or str) types by replacing the above with if not isinstance(value, binary_type): value = str(value).encode('utf8') Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba: PY3 port gpo.apply smbtorture testNoel Power2018-12-103-11/+14
| | | | | | | | | | | | 1) configparser.set requires string values 2) self.gp_db.store() etc. neex to pass str object for xml.etree.ElementTree.Element text attribute which needs to be text 3) tdb delete method needs bytes key 4) configparser.write needs a file opened in text mode Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba: fix default params for PY3 ConfigParserNoel Power2018-12-101-1/+1
| | | | | | | | | | The default params for the python3 version of the compat ConfigParser are not correct. Code like foo = ConfigParser() fails because of this. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba/netcmd: PY3 fix samba4.blackbox.trust_utils testNoel Power2018-12-101-4/+4
| | | | | | In python3 we are using ldb.bytes where we need strings Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba/tests: Py3 port for samba.tests.auth_log_netlogon_bad_creds.sambaNoel Power2018-12-101-3/+2
| | | | | | | fix unicode doesn't exist error in PY3 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* PY3: wrap filter calls with list where list is expectedNoel Power2018-12-102-2/+2
| | | | | | | filter in PY2 returns list in PY3 it returns an iterator Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba/tests: PY3 port samba.tests.dnsNoel Power2018-12-103-11/+11
| | | | | | | | | | | | | Misc hanges needed to get make test TEST=samba.tests.dns & samb.tests.dns_fowarder to run and pass under PY3 * socket.send needs bytes not string * rec.dwTimeStamp expects int not float (in PY3 / operator will give float results, for int use '//' instead) * re.match using bytes needs a bytes search term Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* PY3: net.change_password & net.set_password take string not bytesNoel Power2018-12-104-10/+10
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba: PY3 Credential.set_password takes stringNoel Power2018-12-101-1/+1
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba: Py3 Use new compat.sockerserver symbolNoel Power2018-12-101-1/+1
| | | | | | | | SocketServer symbol changed in PY3 to socketserver so we need to use a compat symbol for PY2/PY3 code. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba: PY3 compat py2/p3 symbol for SocketServer/socketserverNoel Power2018-12-101-0/+2
| | | | | | | | | SocketServer was renamed to socketserver in Py3, this patch create a samba.compat.SocketServer which can be used in py2 or py3 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba: PY3 ord needs 'str' type not intNoel Power2018-12-102-3/+3
| | | | | | | | | string_to_byte_array returns not a bytearray (as the name suggests) but a list of byte values (int). Some code expects the list so even using a 'real' bytearray wont work. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba.tests: Ensure samba-tool is called with correct python ver.Noel Power2018-12-102-5/+5
| | | | | | | | | | * remove unnecessary 'bin/' part of path as base BlackBox class will do this anyway and also ensure correct detection that command needs to have 'PYTHON=blah' addeded * modify shell script so PYTHON variable if set is prepended Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ldb: complex expression testingAaron Haslett2018-12-071-0/+473
| | | | | | | | | | | | | Tests that prepare complex ldap expressions and equivalent python expressions, then compare the results of the two. Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com> Autobuild-User(master): Gary Lockyer <gary@samba.org> Autobuild-Date(master): Fri Dec 7 07:07:08 CET 2018 on sn-devel-144
* docs-xml: add "smbd max async dosmode"Ralph Boehme2018-12-061-0/+2
| | | | | | | | | | | | | | | | The parameter is added to the lists of ignored-paremteres in the samba.docs tests, as the given default "aio max threads * 2" works only as manpage string. "aio max threads" can only be calculated at run time and requires a handle to a pthreadpool_tevent which loadparm will never have. Because of that lp_smbd_max_async_dosmode() will always return 0 as default and it's up to the caller to calculate "aio max threads * 2" if lp_smbd_max_async_dosmode() returns 0. Cf the next commit. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tests:docs: add a exceptions setRalph Boehme2018-12-061-1/+6
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tests:docs: reindent special_cases to one by lineRalph Boehme2018-12-061-9/+26
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* traffic_replay: Add a max-members option to cap group sizeTim Beale2018-12-041-4/+30
| | | | | | | | | | | | | | | | | | | | | | | traffic_replay tries to distribute the users among the groups in a realistic manner - some groups will have almost all users in them. However, this becomes a problem when testing a really large database, e.g. we may want 100K users, but no more than 5K users in each group. This patch adds a max-member option so we can limit how big the groups actually get. If we detect that a group exceeds the max-members, we reset the group's probability (of getting selected) to zero, and then recalculate the cumulative distribution. The means that the group should no longer get selected by generate_random_membership(). (Note we can't completely remove the group from the list because that changes the list-index-to-group-ID mapping). Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Dec 4 12:22:50 CET 2018 on sn-devel-144
* traffic: Rework how assignments are generated slightlyTim Beale2018-12-041-19/+14
| | | | | | | | | We want to cap the number of members that can be in a group. But first, we need to tweak how the assignment dict gets generated, so that we get rid of the intermediary set. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests: Add test-case for 'group list --verbose'Tim Beale2018-12-041-0/+41
| | | | | | | | | Check that the number of members reported is correct. (This change somehow got left off the ca570bd4827aa commit that was actually delivered). Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* netcmd: Minor changes to 'group stats' commandTim Beale2018-12-041-18/+25
| | | | | | | | | | | | | | | | | These changes were inadvertently left off 0c910245fca70948a3. (They were made to the 2nd patch-set iteration posted to the mailing-list, but for some reason the first patch-set got delivered). Changes are: + rework some variable names for better readability + Average members defaulted to int, so lost any floating point precision. + Replace 'Min members' (which was fairly meaningless) with 'Median members per group'. + Fix flake8 long line warnings Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2018-14629: Tests to expose regression from dns cname loop fixAaron Haslett2018-12-041-0/+101
| | | | | | | | | | These tests expose the regression described by Stefan Metzmacher in discussion on the bugzilla paged linked below. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13600 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4 smbd standard tests: limit forked processesGary Lockyer2018-11-301-0/+78
| | | | | | | | Tests to confirm the standard process model honours the smbd.conf variable "max smbd processes", when forking a new process on accept. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix spelling mistakesOlly Betts2018-11-301-1/+1
| | | | | | Signed-off-by: Olly Betts <olly@survex.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2018-14629 dns: CNAME loop prevention using counterAaron Haslett2018-11-281-0/+22
| | | | | | | | | | | Count number of answers generated by internal DNS query routine and stop at 20 to match Microsoft's loop prevention mechanism. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13600 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dns: prevent self-referencing CNAMEAaron Haslett2018-11-281-0/+44
| | | | | | | | | | | Stops the user from adding a self-referencing CNAME over RPC, which is an easy mistake to make with samba-tool. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13600 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* tests: Rework backup test inheritance to make LP constraints clearerTim Beale2018-11-272-14/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | The backup tests have a special constraint where we always want to use check_output() over runcmd(). The reason is we need the samba-tool backup/restore commands executed in a separate process. Otherwise the global underlying LoadParm can accumulate settings from earlier test case runs. We can avoid someone in future inadvertently running runcmd() by mistake, by simply changing the inheritance so we no longer inherit from SambaToolCmdTest (so the runcmd functions are no longer present). The comment explaining this has been moved to the top of the file. Note that the TestCaseInTempDir inheritance was redundant. BlackboxTestCase inherits from TestCaseInTempDir (and SambaToolCmdTest was inheriting from BlackboxTestCase). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Tim Beale <timbeale@samba.org> Autobuild-Date(master): Tue Nov 27 06:57:03 CET 2018 on sn-devel-144
* tests: Work out DOMSID via samdb rather than environsTim Beale2018-11-271-9/+7
| | | | | | | | | | | | | | | | | | | Not all testenvs have the DOMSID set as an environment variable. However, it's easy enough to work out from querying the samdb. This is a slight change in that we use a source4-generated loadparm to connect to the DB (self.lp is source3-generated, presumably for some SMB connection dependency). This change is so we can run the ntacls_backup tests against a DC with SMBv1 disabled (the restoredc). Note that currently the tests fail in the smb.SMB() connection in the setUp(), so we can't run them as part of autobuild just yet (because we can't known-fail test errors). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba/test: PY3 port samba.tests.domain_backupNoel Power2018-11-271-3/+4
| | | | | | | | | | | | The restoredc already runs under python3, so before we can run the domain_backup tests against the restoredc, we need to make sure they work under python3. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Noel Power <noel.power@suse.com> Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests: Handle backup command exceptions as test failures, not errorsTim Beale2018-11-272-1/+14
| | | | | | | | | | | | | | | | | | | | | | | If the backup command fails (i.e. throws an exception), we want the test to fail. This makes it easier to mark tests as 'knownfail' (because we can't knownfail test errors). In theory, this should just involve updating run_cmd() to catch any exceptions from the command and then call self.fail(). However, if the backup command fails, it can leave behind files in the targetdir. Partly this is intentional, as these files may provide clues to users as to why the command failed. However, in selftest, it causes the TestCaseInTempDir._remove_tempdir() assertion to fire. Because this assert actually gets run as part of the teardown, the assertion gets treated as an error rather than a failure (and so we can't knownfail the backup tests). To get around this, we remove any files in the tempdir prior to calling self.fail(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests: Rework backup test_backup_invalid_args test-caseTim Beale2018-11-271-6/+9
| | | | | | | | | | | | | | | self.create_backup() uses self.run_cmd(), which is a wrapper around self.check_output(). Rework the code to call the underlying check_output() function directly instead. The reason we're doing this is we want run_cmd() to catch exceptions and fail the test (i.e. in the next patch). However, we can't do that because this test case relies on receiving the exceptions. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* samba-tool processes: display pre-fork masters and workersGary Lockyer2018-11-231-6/+69
| | | | | | | | | | | | | | | | | | | | | | | | Tag prefork work processes with "(worker 0)", and sort the process list on server name to get a consistent order. Service: PID -------------------------------------- cldap_server 15588 ... ldap_server 15584 ldap_server(worker 0) 15627 ldap_server(worker 1) 15630 ldap_server(worker 2) 15632 ldap_server(worker 3) 15634 nbt_server 15576 notify-daemon 15638 ... samba 0 ... wrepl_server 15580 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* source4 smbd test: prefork process restartGary Lockyer2018-11-231-0/+467
| | | | | | | | Add tests for the restarting of failed/terminated process, by the pre-fork process model. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* logger: use color automatically for a ttyJoe Guo2018-11-211-2/+5
| | | | | | | | | Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Nov 21 10:46:20 CET 2018 on sn-devel-144