Samir Aguiar [Fri, 14 Dec 2018 18:28:00 +0000]
Fix remote scheduling of programs
When scheduling a program on a remote VM, the schedule file was
not being sent to the VM. Also, when removing previously schedule
files rm was waiting for confirmation since we didn't pass it
the `-f` option.
Samir Aguiar [Fri, 14 Dec 2018 18:27:06 +0000]
Overwrite run_cmd timeout in wait_for_run
The default timeout of 60 seconds might not be enough
Samir Aguiar [Fri, 14 Dec 2018 18:24:16 +0000]
Add timeout support to run_cmd
When calling shell commands on a VM we have a default timeout
of 60 seconds (in the session functions designed to run remote
commands). However, some arnied_wrapper functions such as
`wait_for_run` (which calls `arnied_helper
--wait-for-program-timeout`) require a larger timeout, so we
need to be able to overwrite the default.
Christian Herdtweck [Thu, 7 Feb 2019 15:20:36 +0000]
Merge branch 'call-helper-no-default-split'
Christian Herdtweck [Thu, 7 Feb 2019 15:15:45 +0000]
Merge branch 'cnfvar-fixes'
Christian Herdtweck [Fri, 21 Dec 2018 15:25:17 +0000]
test_call_helpers: create unittests for subprocess_run
Check that subprocess_run is compatible with python3.5 subprocess.run
Philipp Gesang [Thu, 7 Feb 2019 14:42:21 +0000]
tidy up cnfvar.py unit tests
This batch of unit tests was disabled since the switch to Python3
on account of minor encoding troubles. Reactivate it and ensure
encoding and escaping are handled properly.
Christian Herdtweck [Fri, 21 Dec 2018 15:24:33 +0000]
test_call_helpers: fix Comments
Christian Herdtweck [Fri, 21 Dec 2018 15:22:32 +0000]
call_helpers: Make default behaviour of subprocess_run compatible
subprocess_run just calls call_and_capture which has different default
settings (return text instead of bytes, split lines).
However, subprocess_run should be a drop-in replacement of the python3.5
subprocess.run function, so should behave the same way.
This little trick fixed e.g. calls to "get_cnf -j" called from cnfvar.py
on python 3.3 (current intra2net system version)
Philipp Gesang [Thu, 7 Feb 2019 14:25:04 +0000]
accept both bytes and str for cnfvar readers
Make both the CNF format and the JSON readers handle bytes and
str transparently.
(Note there is still a deplorable asymmetry in the routines such
that the JSON path will convert to *str* whereas the CNF part,
assuming single-byte encoded data, will convert to *bytes*. This
is necessary for compatibility reasons until the Intranator gets
a more recent Python interpreter.)
Philipp Gesang [Thu, 7 Feb 2019 14:15:10 +0000]
allow selecting individual tests in unittest wrapper
Extend run_unittests.sh so it doesn't necessarily always run
everything:
$ ./run_unittests.sh # -> as before
$ ./run_unittests.sh test.test_cnfvar # run test/test_cnfvar.py
$ ./run_unittests.sh test_cnfvar # run test/test_cnfvar.py
Philipp Gesang [Thu, 7 Feb 2019 13:45:40 +0000]
handle data escaping properly in cnf vars
libcnffile has an additional step that strips escaping from
var data so this:
42 MY_VAR,0: "foo\"bar\"baz"
is actually a valid CNF_VAR with a data member equals ``foo"bar"baz''.
Till now, cnfvar.py would reject such a line because of the
stricter matching. Since escaped strings are ubiquitous in JSON
encoded data, this must be handled properly. (Ironically this is
not an issue with the JSON interface due to the builtin string
escaping rules of the format.)
Imitate the behavior of libcnffile so properly escaped double
quotes don't terminate the string matching. Lucky for us we can
get away with extending the line regex with an alternating
pattern in a non-matching group ``(?:...''.
Christian Herdtweck [Thu, 7 Feb 2019 11:59:17 +0000]
Create unittests for case changes of cnfvar varnames
Philipp Gesang [Thu, 7 Feb 2019 13:16:44 +0000]
normalize cnfvars for JSON output too
Reported by Christian: The normalization pass that ensures
varnames are uppercase was missing from the JSON based routines
which caused them to be rejected by set_cnf(). Implement it by
passing a normalized copy of the CNF tree to the json writer.
Christian Herdtweck [Thu, 31 Jan 2019 15:06:49 +0000]
Fix debug output line in dial.py
Christian Herdtweck [Thu, 31 Jan 2019 13:10:20 +0000]
Convert cnfvar names to lowercase on json import
read_cnf already converts all variable names to lower case. Do the same for
read_cnf_json to get consistent behaviour. SimpleCnf already relies on this.
Christian Herdtweck [Thu, 31 Jan 2019 13:08:58 +0000]
Remove unnecessary creation of reference
Christian Herdtweck [Thu, 31 Jan 2019 13:08:22 +0000]
Correct doc in simple_cnf
Christian Herdtweck [Tue, 22 Jan 2019 09:59:45 +0000]
Merge branch 'less-unittest-clutter'
Christian Herdtweck [Wed, 14 Nov 2018 10:34:41 +0000]
Disable debug output in log_read
Fixed based on Plamen's review.
Christian Herdtweck [Wed, 5 Dec 2018 15:27:18 +0000]
Create 2 pyi2ncommon rpms: for py3.3 and py3.6
The python version, for which pyi2ncommon is installed on target machine,
is fixed in the rpm. It defaults to same version as build host. Managed
to change that by creating setup.cfg file dynamically while running
setup.py . With help of that script, can now create one version for
autotest (py3.6) and one for I2n systems (py3.3)
Christian Herdtweck [Wed, 5 Dec 2018 15:22:41 +0000]
Do not require fixed python3 version for pyi2ncommon
Christian Herdtweck [Wed, 14 Nov 2018 10:33:26 +0000]
Reduce output from simple_cnf test to warnings
Christian Herdtweck [Wed, 14 Nov 2018 09:53:10 +0000]
Replace deprecated logging function with equivalent
Christian Herdtweck [Wed, 14 Nov 2018 09:53:02 +0000]
Replace deprecated unittest function with equivalent
Christian Herdtweck [Wed, 14 Nov 2018 08:53:08 +0000]
Ensure all opened files/sockets are closed in mail_utils
Philipp Gesang [Thu, 25 Oct 2018 08:47:42 +0000]
bump minor version to keep track of changes
Christian Herdtweck [Mon, 5 Nov 2018 11:22:07 +0000]
Merge branch 'util-resurrection'
Christian Herdtweck [Mon, 5 Nov 2018 10:30:40 +0000]
Fix doc strings for text_helpers (except color stuff)
Thanks to Plamen for hint in review
Christian Herdtweck [Mon, 5 Nov 2018 10:23:34 +0000]
Fix doc string for sysmisc.cd()
Thanks to Plamen for hint
Christian Herdtweck [Mon, 29 Oct 2018 08:56:35 +0000]
Create unittest for size_str
Christian Herdtweck [Mon, 29 Oct 2018 08:56:27 +0000]
Bring back size_str text helper
Had been removed since it was not needed any more. Is needed again, so may
be relevant after all
Christian Herdtweck [Mon, 29 Oct 2018 08:41:47 +0000]
Create unit tests for cd context manager
Christian Herdtweck [Mon, 29 Oct 2018 08:41:37 +0000]
Bring back cd context manager
This has been in pyi2ncommon before but was removed since it was only used
in one place (which exists no more). Now needed it again, so bring it back.
Christian Herdtweck [Mon, 5 Nov 2018 11:21:17 +0000]
Merge branch 'cnfvar-dev'
Philipp Gesang [Mon, 5 Nov 2018 09:47:49 +0000]
fix misleading error message in simple_cnf
Philipp Gesang [Mon, 5 Nov 2018 09:39:12 +0000]
normalize varname as cnfvar.py expects it
When cnfvar reads variables, it normalizes the names to
lowercase. Only when emitting classic CNF_FILE style output
the names are uppercased for set_cnf.
Philipp Gesang [Mon, 5 Nov 2018 09:12:35 +0000]
support comparison of SimpleCnf() with non-SimpleCnf() objects
Since __eq__ operations are polymorphic, crashing on different
``types'' is not a good idea.
Philipp Gesang [Mon, 5 Nov 2018 08:58:43 +0000]
validate SimpleCnf inputs
The cnfvar functions cannot handle ``tuple'' inputs since the
inputs are variable length. Make simple_cnf pass a list instead
and reject non-list inputs in the ctor.
Philipp Gesang [Mon, 5 Nov 2018 08:21:49 +0000]
restore simple_cnf/add_single API
Restore an API that vanished at some point despite there still
being users.
This is commit
fa747d25a7c47a1ceef165c4e1667b9755c9da0d on
autotest/i2n. The original commit message in full:
In
commit
5f6735c41fc769ac9ba6ee62754ab2b7da3d68d2
Author: Christian Herdtweck <christian.herdtweck@intra2net.com>
Date: Wed Apr 5 18:14:02 2017 +0200
Extend SimpleCnf.add_single to SimpleCnf.add
this ApI was folded into .add() without providing an overload for
downstream consumers. Provide the symbol again as a thin wrapper
around .add() and hope for the behavior to remain unaffected.
Philipp Gesang [Tue, 24 Jul 2018 13:46:54 +0000]
fix cnfvar crash on end inside child vars
The recursive call to parse_cnf_children() may also return None
if it hit EOF.
Philipp Gesang [Fri, 8 Dec 2017 12:34:46 +0000]
lowercase all incoming varnames
The CNF store is case-indifferent regarding variable names when
reading from it, so just normalize all of them when internalizing
variables.
Philipp Gesang [Tue, 5 Dec 2017 12:47:45 +0000]
when emitting CNF lines, force capitalization of variable names
Philipp Gesang [Tue, 5 Dec 2017 12:46:47 +0000]
add cnfvar helper for counting CNF trees
Philipp Gesang [Tue, 5 Dec 2017 10:55:24 +0000]
allow parent-less renumbering of CNF_VARs
When more control is needed over the line numbers a CNF_VAR and
its children are assigned, the *parent* linenumber can be used to
pass an offset. Add a parameter *toplevel* to prevent the parent
index from being set.
Philipp Gesang [Tue, 5 Dec 2017 10:38:40 +0000]
loosen criteria on CNF object roots
Single CNF_VARs are technically malformed since CNF file is
always a list of vars. However, any isolated CNF line can be
trivially converted to a valid CNF_VAR by wrapping it in a list
ctor, so do that automatically when determining the root of a
CNF_VAR.
Philipp Gesang [Tue, 5 Dec 2017 10:02:18 +0000]
fix renumbering in cnfvar.py
Philipp Gesang [Fri, 1 Dec 2017 15:14:56 +0000]
avoid formatting binary strings
Postpone bytes conversion of CNF-encoded objects until the last
moment to work around missing interpolation of bytes objects in
Python 3.3 (the version still in use on the Intranator).
Reference: https://bufs.python.org/issue3982
Christian Herdtweck [Wed, 24 Oct 2018 09:51:37 +0000]
Update version to 1.3
Plamen Dimitrov [Tue, 30 Oct 2018 15:12:27 +0000]
Use HTTP firewall ruleset option starting from I2N release 6.5.0
Christian Herdtweck [Wed, 24 Oct 2018 15:30:27 +0000]
Fix encoding issue when building rpm
This issue never occured in regular shells because usually LOCALE and
system encoding and similar is set.
Christian Herdtweck [Wed, 24 Oct 2018 14:40:22 +0000]
Add CONTRIBUTING guide with rules for contributors
Christian Herdtweck [Wed, 24 Oct 2018 13:18:52 +0000]
Make debug print in test optional
Christian Herdtweck [Wed, 24 Oct 2018 13:11:27 +0000]
Fix units and threshold for log read test
Christian Herdtweck [Wed, 24 Oct 2018 13:09:03 +0000]
Fix cnf var unit test: cnf lines can have different order
Plamen Dimitrov [Mon, 5 Nov 2018 08:58:14 +0000]
Merge branch 'autotest-migration' into master
This branch migrates all utilities originally developed for Autotest but
considered generalizable beyond its scope and useful for other projects
requiring python bindings for I2N related functionality.
Any future improvement and refactoring on the contributed modules will
be done here and made available for client code including Autotest.
Plamen Dimitrov [Sun, 30 Sep 2018 05:20:10 +0000]
Include the cnfline subpackage in the setuptools script
Plamen Dimitrov [Tue, 16 Oct 2018 19:28:21 +0000]
Avoid creating unclean debug directories during build cnfvar unit tests
Plamen Dimitrov [Wed, 26 Sep 2018 15:20:53 +0000]
Remove arnied utility stub now that the actual wrapper is available
Plamen Dimitrov [Thu, 4 Oct 2018 04:45:32 +0000]
Backport some subprocess py3.5+ functionality for older python versions
The main platform using these utilities only supports py3.3 making
this extra effort necessary for a seamless caller experience.
Plamen Dimitrov [Tue, 23 Oct 2018 07:58:13 +0000]
Restrict the logging to pyi2ncommon namespace
The logging for the entire library can be managed through its
root logger and thus of all migrated functionality.
Plamen Dimitrov [Tue, 23 Oct 2018 07:58:26 +0000]
Use the correct sourcing for all added unit tests
Plamen Dimitrov [Wed, 26 Sep 2018 15:25:19 +0000]
Adapt all internal imports in relative fashion
We were modifying the system path before but now we can use
cleaner importing approach.
Plamen Dimitrov [Sun, 23 Sep 2018 16:45:39 +0000]
Add GPLv2 licensing headers to all migrated utilities
Plamen Dimitrov [Sun, 23 Sep 2018 16:27:00 +0000]
Migrate utilities from the autotest-intra2net repo
Plamen Dimitrov [Fri, 15 Jun 2018 18:12:12 +0000]
Use the system independent null device provided by python
Plamen Dimitrov [Fri, 15 Jun 2018 18:11:44 +0000]
Convert configs to bytes to make some unit tests work with cnfvar
Plamen Dimitrov [Fri, 15 Jun 2018 18:02:44 +0000]
Unify the cnf reading API to bytes argument and returned str
Also fix byte usage in config preparation with the above assumption.
Christian Herdtweck [Tue, 9 Oct 2018 08:15:49 +0000]
Update library description, remove autotest
Christian Herdtweck [Tue, 9 Oct 2018 07:44:32 +0000]
Fix iter_helper import and test
Christian Herdtweck [Mon, 8 Oct 2018 07:44:02 +0000]
Bring back call helpers
Were not used sofar but will be extendend and used again by autotest code
Christian Herdtweck [Mon, 8 Oct 2018 07:39:38 +0000]
Merge branch 'zip-stream-test'
Christian Herdtweck [Thu, 24 May 2018 10:29:49 +0000]
Fix error wrapping stdout when redirecting
In some cases (e.g. redirecting stdout to shell), the automatic determination
in ZipFile constructor whether its file argument can seek() and tell() fails.
stdout seems to support both but returns bogus values for tell(), resulting
in negative sizes when writing the archive's end record.
Provide a fix with additional arg force_wrap
Also ensure that CRCs are always correct as suggested in python docs and
stackoverflow
Christian Herdtweck [Wed, 23 May 2018 10:36:03 +0000]
Simplify imports in zip_stream and add comments
Christian Herdtweck [Wed, 23 May 2018 10:35:02 +0000]
Create unittest for zip_stream
Only runs in python3 (zipfile35 could be made py2-compatible by importing
print() and removing PyZipFile, but also have trouble with byte sizes in
struct.pack)
Christian Herdtweck [Fri, 15 Jun 2018 09:06:26 +0000]
Create unittest for argpars_helpers
Christian Herdtweck [Fri, 15 Jun 2018 09:06:02 +0000]
Create new arparse_helpers with NonExitingParser and existing_file
Christian Herdtweck [Fri, 22 Jun 2018 12:09:49 +0000]
Created unittest for iter_helpers
Christian Herdtweck [Fri, 22 Jun 2018 12:09:30 +0000]
Create iter_helper interesting_repetition
Christian Herdtweck [Mon, 8 Oct 2018 07:29:39 +0000]
Merge clean-up branch
Christian Herdtweck [Tue, 2 Oct 2018 08:37:00 +0000]
Update README
Christian Herdtweck [Tue, 2 Oct 2018 08:36:50 +0000]
Fix comments in check.sh
Christian Herdtweck [Tue, 2 Oct 2018 08:36:33 +0000]
Mention autotest in setup.py, update template files
Christian Herdtweck [Tue, 2 Oct 2018 08:35:55 +0000]
Fix whitespace in comments in template
Christian Herdtweck [Tue, 2 Oct 2018 08:35:06 +0000]
Finally break ties with python2
Christian Herdtweck [Tue, 2 Oct 2018 08:02:54 +0000]
Remove unused test_helpers
Christian Herdtweck [Tue, 2 Oct 2018 08:01:12 +0000]
Replace only usage of test_helpers
Christian Herdtweck [Tue, 2 Oct 2018 08:00:54 +0000]
Remove unused call_helpers
Christian Herdtweck [Mon, 8 Oct 2018 07:27:14 +0000]
Remove deprecated log reader utility
Use log_read instead
Christian Herdtweck [Mon, 8 Oct 2018 07:26:43 +0000]
Remove old unused file helpers
Half-baked re-implementation of psutils, no good
Christian Herdtweck [Fri, 3 Aug 2018 13:52:56 +0000]
Fix name of project in doc config
Christian Herdtweck [Fri, 3 Aug 2018 13:45:55 +0000]
Create sphinx docu only of src, not of test
Christian Herdtweck [Fri, 3 Aug 2018 13:45:32 +0000]
Update copyright in sphinx docu
Christian Herdtweck [Fri, 3 Aug 2018 13:28:09 +0000]
Correct formatting of comments in template, add some more text
Christian Herdtweck [Fri, 3 Aug 2018 13:27:44 +0000]
Unify license, copyright and author information
Christian Herdtweck [Mon, 18 Jun 2018 08:17:49 +0000]
Fixed one error and some whitespace found by pycharm
Christian Herdtweck [Fri, 15 Jun 2018 11:15:55 +0000]
Make a note in file_helpers to use psutils instead of re-implementing it
Christian Herdtweck [Tue, 22 May 2018 10:56:17 +0000]
Merge branch 'install-subdir'
Christian Herdtweck [Tue, 22 May 2018 10:33:30 +0000]
Skip CnfVar unittests
These tests seem to never have worked
Christian Herdtweck [Tue, 22 May 2018 10:11:34 +0000]
Clarify that disc_filler is no unittest