mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
Merge pull request #153 from s0undt3ch/develop
Fix test suite under SuSE SLES SP1
This commit is contained in:
commit
8de377be9c
2 changed files with 35 additions and 12 deletions
|
@ -9,9 +9,12 @@ Version 1.5.5:
|
||||||
* Ubuntu Lucid Daily PPA
|
* Ubuntu Lucid Daily PPA
|
||||||
* SmartOS no longer ignores $SALT_ETC_DIR. Matthieu Guegan!
|
* SmartOS no longer ignores $SALT_ETC_DIR. Matthieu Guegan!
|
||||||
* FreeBSD no longer ignores $SALT_ETC_DIR. Thanks Geoff Garside!
|
* FreeBSD no longer ignores $SALT_ETC_DIR. Thanks Geoff Garside!
|
||||||
|
* FreeBSD does not try to install pkgng if pkg is installed. Thanks Geoff Garside!
|
||||||
* SunOS (Make use of XPG4 binaries on SunOS). Thanks Matthieu Guegan!
|
* SunOS (Make use of XPG4 binaries on SunOS). Thanks Matthieu Guegan!
|
||||||
* openSUSE (Don't fail if only one of the repositories failed to update)
|
* openSUSE (Don't fail if only one of the repositories failed to update)
|
||||||
* Arch (Fixed the GPG issues for git installations)
|
* Arch (Fixed the GPG issues for git installations)
|
||||||
|
* Distro Support Added:
|
||||||
|
* Gentoo. Thanks kaithar!
|
||||||
|
|
||||||
|
|
||||||
Version 1.5.4:
|
Version 1.5.4:
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
:license: Apache 2.0, see LICENSE for more details.
|
:license: Apache 2.0, see LICENSE for more details.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
import re
|
||||||
import glob
|
import glob
|
||||||
import shutil
|
import shutil
|
||||||
from bootstrap.unittesting import *
|
from bootstrap.unittesting import *
|
||||||
|
@ -79,7 +80,8 @@ OS_REQUIRES_PIP_ALLOWED = (
|
||||||
# passing -P to the bootstrap script.
|
# passing -P to the bootstrap script.
|
||||||
# The GRAINS['os'] which are in this list, requires that extra argument.
|
# The GRAINS['os'] which are in this list, requires that extra argument.
|
||||||
'SmartOS',
|
'SmartOS',
|
||||||
'Suse' # Need to revisit openSUSE and SLES for the proper OS grain.
|
'Suse', # Need to revisit openSUSE and SLES for the proper OS grain.
|
||||||
|
#'SUSE Enterprise Server', # Only SuSE SLES SP1 requires -P (commented out)
|
||||||
)
|
)
|
||||||
|
|
||||||
# SLES grains differ from openSUSE, let do a 1:1 direct mapping
|
# SLES grains differ from openSUSE, let do a 1:1 direct mapping
|
||||||
|
@ -87,6 +89,24 @@ CLEANUP_COMMANDS_BY_OS_FAMILY['SUSE Enterprise Server'] = \
|
||||||
CLEANUP_COMMANDS_BY_OS_FAMILY['Suse']
|
CLEANUP_COMMANDS_BY_OS_FAMILY['Suse']
|
||||||
|
|
||||||
|
|
||||||
|
IS_SUSE_SP1 = False
|
||||||
|
if os.path.isfile('/etc/SuSE-release'):
|
||||||
|
match = re.search(
|
||||||
|
r'PATCHLEVEL(?:[\s]+)=(?:[\s]+)1',
|
||||||
|
open('/etc/SuSE-release').read()
|
||||||
|
)
|
||||||
|
IS_SUSE_SP1 = match is not None
|
||||||
|
|
||||||
|
|
||||||
|
def requires_pip_based_installations():
|
||||||
|
if GRAINS['os'] == 'SUSE Enterprise Server' and IS_SUSE_SP1:
|
||||||
|
# Only SuSE SLES SP1 requires -P
|
||||||
|
return True
|
||||||
|
if GRAINS['os'] not in OS_REQUIRES_PIP_ALLOWED:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
class InstallationTestCase(BootstrapTestCase):
|
class InstallationTestCase(BootstrapTestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -150,7 +170,7 @@ class InstallationTestCase(BootstrapTestCase):
|
||||||
self.skipTest('\'/bin/bash\' was not found on this system')
|
self.skipTest('\'/bin/bash\' was not found on this system')
|
||||||
|
|
||||||
args = []
|
args = []
|
||||||
if GRAINS['os'] in OS_REQUIRES_PIP_ALLOWED:
|
if requires_pip_based_installations():
|
||||||
args.append('-P')
|
args.append('-P')
|
||||||
|
|
||||||
self.assert_script_result(
|
self.assert_script_result(
|
||||||
|
@ -178,7 +198,7 @@ class InstallationTestCase(BootstrapTestCase):
|
||||||
|
|
||||||
def test_install_using_sh(self):
|
def test_install_using_sh(self):
|
||||||
args = []
|
args = []
|
||||||
if GRAINS['os'] in OS_REQUIRES_PIP_ALLOWED:
|
if requires_pip_based_installations():
|
||||||
args.append('-P')
|
args.append('-P')
|
||||||
|
|
||||||
self.assert_script_result(
|
self.assert_script_result(
|
||||||
|
@ -205,7 +225,7 @@ class InstallationTestCase(BootstrapTestCase):
|
||||||
|
|
||||||
def test_install_explicit_stable(self):
|
def test_install_explicit_stable(self):
|
||||||
args = []
|
args = []
|
||||||
if GRAINS['os'] in OS_REQUIRES_PIP_ALLOWED:
|
if requires_pip_based_installations():
|
||||||
args.append('-P')
|
args.append('-P')
|
||||||
|
|
||||||
args.append('stable')
|
args.append('stable')
|
||||||
|
@ -234,7 +254,7 @@ class InstallationTestCase(BootstrapTestCase):
|
||||||
|
|
||||||
def test_install_daily(self):
|
def test_install_daily(self):
|
||||||
args = []
|
args = []
|
||||||
if GRAINS['os'] in OS_REQUIRES_PIP_ALLOWED:
|
if requires_pip_based_installations():
|
||||||
args.append('-P')
|
args.append('-P')
|
||||||
|
|
||||||
args.append('daily')
|
args.append('daily')
|
||||||
|
@ -267,7 +287,7 @@ class InstallationTestCase(BootstrapTestCase):
|
||||||
|
|
||||||
def test_install_stable_piped_through_sh(self):
|
def test_install_stable_piped_through_sh(self):
|
||||||
args = 'cat {0} | sh '.format(BOOTSTRAP_SCRIPT_PATH).split()
|
args = 'cat {0} | sh '.format(BOOTSTRAP_SCRIPT_PATH).split()
|
||||||
if GRAINS['os'] in OS_REQUIRES_PIP_ALLOWED:
|
if requires_pip_based_installations():
|
||||||
args.extend('-s -- -P'.split())
|
args.extend('-s -- -P'.split())
|
||||||
|
|
||||||
self.assert_script_result(
|
self.assert_script_result(
|
||||||
|
@ -324,7 +344,7 @@ class InstallationTestCase(BootstrapTestCase):
|
||||||
|
|
||||||
def test_install_specific_git_tag(self):
|
def test_install_specific_git_tag(self):
|
||||||
args = []
|
args = []
|
||||||
if GRAINS['os'] in OS_REQUIRES_PIP_ALLOWED:
|
if requires_pip_based_installations():
|
||||||
args.append('-P')
|
args.append('-P')
|
||||||
|
|
||||||
args.extend(['git', CURRENT_SALT_STABLE_VERSION])
|
args.extend(['git', CURRENT_SALT_STABLE_VERSION])
|
||||||
|
@ -353,7 +373,7 @@ class InstallationTestCase(BootstrapTestCase):
|
||||||
|
|
||||||
def test_install_specific_git_sha(self):
|
def test_install_specific_git_sha(self):
|
||||||
args = []
|
args = []
|
||||||
if GRAINS['os'] in OS_REQUIRES_PIP_ALLOWED:
|
if requires_pip_based_installations():
|
||||||
args.append('-P')
|
args.append('-P')
|
||||||
|
|
||||||
args.extend(['git', '2b6264de62bf2ea221bb2c0b8af36dfcfaafe7cf'])
|
args.extend(['git', '2b6264de62bf2ea221bb2c0b8af36dfcfaafe7cf'])
|
||||||
|
@ -430,7 +450,7 @@ class InstallationTestCase(BootstrapTestCase):
|
||||||
Test if installing a salt-master works
|
Test if installing a salt-master works
|
||||||
'''
|
'''
|
||||||
args = []
|
args = []
|
||||||
if GRAINS['os'] in OS_REQUIRES_PIP_ALLOWED:
|
if requires_pip_based_installations():
|
||||||
args.append('-P')
|
args.append('-P')
|
||||||
|
|
||||||
args.extend(['-N', '-M'])
|
args.extend(['-N', '-M'])
|
||||||
|
@ -474,7 +494,7 @@ class InstallationTestCase(BootstrapTestCase):
|
||||||
# )
|
# )
|
||||||
#
|
#
|
||||||
# args = []
|
# args = []
|
||||||
# if GRAINS['os'] in OS_REQUIRES_PIP_ALLOWED:
|
# if requires_pip_based_installations():
|
||||||
# args.append('-P')
|
# args.append('-P')
|
||||||
#
|
#
|
||||||
# args.extend(['-N', '-S'])
|
# args.extend(['-N', '-S'])
|
||||||
|
@ -506,7 +526,7 @@ class InstallationTestCase(BootstrapTestCase):
|
||||||
Check if distributions which require `-P` to allow pip to install
|
Check if distributions which require `-P` to allow pip to install
|
||||||
packages, fail if that flag is not passed.
|
packages, fail if that flag is not passed.
|
||||||
'''
|
'''
|
||||||
if GRAINS['os'] not in OS_REQUIRES_PIP_ALLOWED:
|
if not requires_pip_based_installations():
|
||||||
self.skipTest(
|
self.skipTest(
|
||||||
'Distribution {0} does not require the extra `-P` flag'.format(
|
'Distribution {0} does not require the extra `-P` flag'.format(
|
||||||
GRAINS['os']
|
GRAINS['os']
|
||||||
|
@ -560,7 +580,7 @@ class InstallationTestCase(BootstrapTestCase):
|
||||||
# Now run the bootstrap script over an existing git checkout and see
|
# Now run the bootstrap script over an existing git checkout and see
|
||||||
# if it properly updates.
|
# if it properly updates.
|
||||||
args = []
|
args = []
|
||||||
if GRAINS['os'] in OS_REQUIRES_PIP_ALLOWED:
|
if requires_pip_based_installations():
|
||||||
args.append('-P')
|
args.append('-P')
|
||||||
|
|
||||||
args.extend(['git', CURRENT_SALT_STABLE_VERSION])
|
args.extend(['git', CURRENT_SALT_STABLE_VERSION])
|
||||||
|
|
Loading…
Add table
Reference in a new issue