Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for Kali Linux Rolling #214

Merged
merged 1 commit into from
May 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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