Skip to content

Commit

Permalink
Add test for Kali Linux Rolling
Browse files Browse the repository at this point in the history
  • Loading branch information
nir0s committed May 9, 2018
1 parent dd6c1e6 commit 822f49c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
10 changes: 10 additions & 0 deletions tests/resources/distros/kali/etc/os-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PRETTY_NAME="Kali GNU/Linux Rolling"
NAME="Kali GNU/Linux"
ID=kali
VERSION="2017.1"
VERSION_ID="2017.1"
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.kali.org/"
SUPPORT_URL="http://forums.kali.org/"
BUG_REPORT_URL="http://bugs.kali.org/"
22 changes: 17 additions & 5 deletions tests/test_distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ def test_arch_os_release(self):
}
self._test_outcome(desired_outcome)

def test_kali_os_release(self):
desired_outcome = {
'id': 'kali',
'name': 'Kali GNU/Linux',
'pretty_name': 'Kali GNU/Linux Rolling',
'version': '2017.1',
'pretty_version': '2017.1',
'best_version': '2017.1',
'like': 'debian'
}
self._test_outcome(desired_outcome)

def test_centos7_os_release(self):
desired_outcome = {
'id': 'centos',
Expand Down Expand Up @@ -584,12 +596,12 @@ def test_unknowndistro_release(self):
'minor_version': '0'
}
self._test_outcome(desired_outcome)

def test_bad_uname(self):
self._setup_for_distro(os.path.join(TESTDISTROS, 'distro',
'baduname'))
self.distro = distro.LinuxDistribution()

assert self.distro.uname_attr('id') == ''
assert self.distro.uname_attr('name') == ''
assert self.distro.uname_attr('release') == ''
Expand Down Expand Up @@ -1530,7 +1542,7 @@ def setup_method(self, test_method):
self._old_listdir = os.listdir
os.listdir = _bad_os_listdir
super(TestOverallWithEtcNotReadable, self).setup_method(test_method)

def teardown_method(self, test_method):
super(TestOverallWithEtcNotReadable, self).teardown_method(test_method)
if os.listdir is _bad_os_listdir:
Expand Down Expand Up @@ -1944,11 +1956,11 @@ def _test_consistency(function, kwargs=None):
]
for key in distro_release_keys:
_test_consistency('distro_release_attr', {'attribute': key})

uname_keys = [
'id',
'name',
'release'
'release'
]
for key in uname_keys:
_test_consistency('uname_attr', {'attribute': key})
Expand Down

0 comments on commit 822f49c

Please sign in to comment.