mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
add windows path and add custom tar
This commit is contained in:
parent
c5035118bf
commit
617f5680e4
3 changed files with 16 additions and 4 deletions
|
@ -175,7 +175,7 @@ def extracted(name,
|
|||
|
||||
.. versionadded:: 2016.3.0
|
||||
|
||||
skip_verify:False
|
||||
skip_verify:False
|
||||
If ``True``, hash verification of remote file sources (``http://``,
|
||||
``https://``, ``ftp://``) will be skipped, and the ``source_hash``
|
||||
argument will be ignored.
|
||||
|
|
BIN
tests/integration/files/file/base/custom.tar.gz
Normal file
BIN
tests/integration/files/file/base/custom.tar.gz
Normal file
Binary file not shown.
|
@ -16,7 +16,17 @@ import integration
|
|||
import salt.utils
|
||||
|
||||
STATE_DIR = os.path.join(integration.FILES, 'file', 'base')
|
||||
ARCHIVE_DIR = '/tmp/archive/'
|
||||
if salt.utils.is_windows():
|
||||
ARCHIVE_DIR = os.path.join("c:/", "tmp")
|
||||
else:
|
||||
ARCHIVE_DIR = '/tmp/archive/'
|
||||
|
||||
#local tar file
|
||||
LOCAL_ARCHIVE_TAR_SOURCE = 'salt://custom.tar.gz'
|
||||
LOCAL_UNTAR_FILE = os.path.join(ARCHIVE_DIR, 'custom', 'README')
|
||||
|
||||
#external sources. Only external sources verify source_hash.
|
||||
#Therefore need to keep to verify source_hash test
|
||||
ARCHIVE_TAR_SOURCE = 'https://github.com/downloads/Graylog2/'\
|
||||
'graylog2-server/graylog2-server-0.9.6p1.tar.gz'
|
||||
UNTAR_FILE = ARCHIVE_DIR + 'graylog2-server-0.9.6p1/README'
|
||||
|
@ -47,15 +57,17 @@ class ArchiveTest(integration.ModuleCase,
|
|||
test archive.extracted with skip_verify
|
||||
'''
|
||||
ret = self.run_state('archive.extracted', name=ARCHIVE_DIR,
|
||||
source=ARCHIVE_TAR_SOURCE, archive_format='tar',
|
||||
source=LOCAL_ARCHIVE_TAR_SOURCE, archive_format='tar',
|
||||
skip_verify=True)
|
||||
self.assertSaltTrueReturn(ret)
|
||||
|
||||
self._check_ext_remove(ARCHIVE_DIR, UNTAR_FILE)
|
||||
self._check_ext_remove(ARCHIVE_DIR, LOCAL_UNTAR_FILE)
|
||||
|
||||
def test_archive_extracted_with_source_hash(self):
|
||||
'''
|
||||
test archive.extracted without skip_verify
|
||||
only external resources work to check to
|
||||
ensure source_hash is verified correctly
|
||||
'''
|
||||
ret = self.run_state('archive.extracted', name=ARCHIVE_DIR,
|
||||
source=ARCHIVE_TAR_SOURCE, archive_format='tar',
|
||||
|
|
Loading…
Add table
Reference in a new issue