mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Version compare standard version strings if available
This commit is contained in:
parent
822f1d3e2a
commit
fb1ad29dd8
@ -59,13 +59,14 @@ class PkgModuleTest(ModuleCase, SaltReturnAssertsMixin):
|
|||||||
lt = ['0.2.4-0ubuntu1', '0.2.4.1-0ubuntu1']
|
lt = ['0.2.4-0ubuntu1', '0.2.4.1-0ubuntu1']
|
||||||
eq = ['0.2.4-0ubuntu1', '0.2.4-0ubuntu1']
|
eq = ['0.2.4-0ubuntu1', '0.2.4-0ubuntu1']
|
||||||
gt = ['0.2.4.1-0ubuntu1', '0.2.4-0ubuntu1']
|
gt = ['0.2.4.1-0ubuntu1', '0.2.4-0ubuntu1']
|
||||||
|
|
||||||
elif grains['os_family'] == 'Suse':
|
elif grains['os_family'] == 'Suse':
|
||||||
lt = ['2.3.0-1', '2.3.1-15.1']
|
lt = ['2.3.0-1', '2.3.1-15.1']
|
||||||
eq = ['2.3.1-15.1', '2.3.1-15.1']
|
eq = ['2.3.1-15.1', '2.3.1-15.1']
|
||||||
gt = ['2.3.2-15.1', '2.3.1-15.1']
|
gt = ['2.3.2-15.1', '2.3.1-15.1']
|
||||||
else:
|
else:
|
||||||
self.skipTest('pkg.version_cmp test has not been configured for \'{}\''.format(grains['os_family']))
|
lt = ['2.3.0', '2.3.1']
|
||||||
|
eq = ['2.3.1', '2.3.1']
|
||||||
|
gt = ['2.3.2', '2.3.1']
|
||||||
|
|
||||||
self.assertEqual(self.run_function(func, lt), -1)
|
self.assertEqual(self.run_function(func, lt), -1)
|
||||||
self.assertEqual(self.run_function(func, eq), 0)
|
self.assertEqual(self.run_function(func, eq), 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user