diff options
author | Scott Moser <smoser@brickies.net> | 2017-06-15 10:03:45 -0400 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2017-06-15 17:10:54 -0400 |
commit | ecb408afa1104fe49ce6eb1dc5708be56abd5cb2 (patch) | |
tree | 8d1161c2f44f07aec73348fa6d2c8a14701d7dd6 /tests/unittests/test_util.py | |
parent | 9ccb8f5e2ab262ee04bb9c103c1302479f7c81d3 (diff) | |
download | vyos-cloud-init-ecb408afa1104fe49ce6eb1dc5708be56abd5cb2.tar.gz vyos-cloud-init-ecb408afa1104fe49ce6eb1dc5708be56abd5cb2.zip |
FreeBSD: Make freebsd a variant, fix unittests and tools/build-on-freebsd.
- Simplify the logic of 'variant' in util.system_info
much of the data from
https://github.com/hpcugent/easybuild/wiki/OS_flavor_name_version
- fix get_resource_disk_on_freebsd when running on a system without
an Azure resource disk.
- fix tools/build-on-freebsd to replace oauth with oauthlib and add
bash which is a dependency for tests.
- update a fiew places that were checking for freebsd but not using
the util.is_FreeBSD()
Diffstat (limited to 'tests/unittests/test_util.py')
-rw-r--r-- | tests/unittests/test_util.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py index 014aa6a3..a73fd26a 100644 --- a/tests/unittests/test_util.py +++ b/tests/unittests/test_util.py @@ -20,6 +20,9 @@ except ImportError: import mock +BASH = util.which('bash') + + class FakeSelinux(object): def __init__(self, match_what): @@ -544,17 +547,17 @@ class TestReadSeeded(helpers.TestCase): class TestSubp(helpers.TestCase): - stdin2err = ['bash', '-c', 'cat >&2'] + stdin2err = [BASH, '-c', 'cat >&2'] stdin2out = ['cat'] utf8_invalid = b'ab\xaadef' utf8_valid = b'start \xc3\xa9 end' utf8_valid_2 = b'd\xc3\xa9j\xc8\xa7' - printenv = ['bash', '-c', 'for n in "$@"; do echo "$n=${!n}"; done', '--'] + printenv = [BASH, '-c', 'for n in "$@"; do echo "$n=${!n}"; done', '--'] def printf_cmd(self, *args): # bash's printf supports \xaa. So does /usr/bin/printf # but by using bash, we remove dependency on another program. - return(['bash', '-c', 'printf "$@"', 'printf'] + list(args)) + return([BASH, '-c', 'printf "$@"', 'printf'] + list(args)) def test_subp_handles_utf8(self): # The given bytes contain utf-8 accented characters as seen in e.g. |