Age | Commit message (Collapse) | Author |
|
|
|
This adds the following tests in test_distros.test_generic:
- test_systemd_in_use
Test the situation in which /run/systemd/system exists.
- test_systemd_not_in_use
Test the situation in which /run/systemd/system does not exists.
- test_systemd_symlink
This tests the situation in which /run/systemd/system exists but is a
*symlink* to a directory, which according to sd_booted() should return
false.
|
|
|
|
|
|
|
|
|
|
to be behind trunk.
`tox -e py27` passes full test suite. Now to work on replacing mocker.
|
|
|
|
|
|
--ignore was being called with ',E121,E...' rather than
'E121,E...'.
that resulted in odd behavior, missing the pep8 errors that are fixed
here.
|
|
+ Scenario with multiple NICs
|
|
|
|
There are a couple new test cases that are now erroring out.
- A usage of the non helper unit testcase base which is trigging
and error on python 2.6 due to lack of method, fix this by using
the base helper class.
- A freebsd distro test check thats looking for /etc/resolv.conf and
examining its contents, which won't exist due to our mocking routine
that does not allow that file to be read.
- A freebsd distro test where the distro class tries to call into
['ifconfig', '-a'] for a set of values, those values don't exist on
the machine I am running on (and likely others machines) so we should
mock the subp function out (that the distro class calls) and correctly
return values that will work for the testcase.
|
|
|
|
|
|
|
|
This just removes comments '# pylint:' things and other code
remnents of pylint.
|
|
Fixed all complaints from running "make pep8". Also version locked
pep8 in test-requirements.txt to ensure that pep8 requirements don't
change without an explicit commit.
|
|
|
|
|
|
Previously if a legacy user: XYZ entry was found, XYZ would not automatically
be promoted to the default user but would instead just be added on as a new
entry to the normalized user list. It appears the behavior that is wanted is
for the XYZ entry to be added on as the default user (thus overriding a distro
provided default user), which better matches how the code previous worked.
LP: #1100920
|
|
|
|
|
|
|
|
|
|
I'm guessing that
with self.assertRaises(Exception):
something here
is an acceptable form in a newer or older python. But my
python (2.7.3-0ubuntu7) doesn't like it.
Interestingly, python unittest doc says:
| Changed in version 2.7: Added the ability to use assertRaises() as
| a context manager.
|
|
|
|
|
|
|
|
|
|
when that group configuration is a dict => members.
LP: #1077245
|
|
1. Remove the usage of the path.join function
now that all code should be going through
the util file methods (and they can be
mocked out as needed).
2. Adjust all occurences of the above join
function to either not use it or replace
it with the standard os.path.join (which
can also be mocked out as needed)
3. Fix pylint from complaining about the
tests folder 'helpers.py' not being found
4. Add a pylintrc file that is used instead
of the options hidden in the 'run_pylint'
tool.
|
|
|
|
Remove the need to have 'default_user' and 'default_user_groups' groups be
hard coded into the distro class, instead let that set of configuration be
located in the config file where it should be specified instead.
|
|
|
|
variables to be expanded which when using
pipes.quote will now not be expanded, so add
some checks to ensure that this case will still happen.
|
|
variables adjusted in sysconfig files are
properly quoted for there common use case,
that being sourced into shell scripts.
|
|
helper objects.
1. Add in a parser for the /etc/hostname file that can be shared
2. Adjust the sysconfig configobj parser to not always quote
fields that it does not need to quote + add in tests around
this to ensure that we don't go nuts with quoting again.
|
|
1. Move out the old helpers that provided oop access/reading/writing
to various standard conf files and place those in parsers instead.
2. Unify the 'update_hostname' which varied very little between distros
and make it generic so that subclasses can only provide a couple of
functions to obtain the hostname updating functionality
3. Implement that new set of functions in rhel/debian
4. Use the new parsers chop_comment function for similar use
cases as well as add a new utils make header function that
can be used for configuration files that are newly generated
to use (less duplication here of this same thing being done
in multiple places.
5. Add in a distro '_apply_hostname' which calls out to the 'hostname'
program to set the system hostname (more duplication elimination).
6. Make the 'constant' filenames being written to for configuration
by the various distros be instance members instead of string
constants 'sprinkled' throughout the code
|
|
preparation for having a new branch
for all of these changes.
|
|
the previous 'user' and make those locations
go through the new distros functions to select
the default user or the user list (depending on usage).
Adjust the tests to check the new 'default' field
that signifies the default user + test the new method
to extract just the default user from a normalized
user dictionary.
|
|
The primary utility here is normalize_user_groups, which would
be called by config modules to get a list of users or groups.
This centralizes what was copied code into this one location.
|
|
|
|
|
|
|
|
|
|
device name, throw an error since rhel can not currently
handle this case.
|
|
and produce a user and group list. Clean this up to
be simpler as well as handle the old 'user' case when
it exists in configuration.
|
|
since it has little dependence on the distros
class itself. Readjust the using code to use
this new module level function instead.
|
|
|