mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add the failing test for saltstack/salt#1879
This commit is contained in:
parent
269bef7112
commit
797defc320
4 changed files with 40 additions and 0 deletions
3
tests/integration/files/file/base/issue-1879/init.sls
Normal file
3
tests/integration/files/file/base/issue-1879/init.sls
Normal file
|
@ -0,0 +1,3 @@
|
|||
/tmp/salttest/issue-1879:
|
||||
file:
|
||||
- touch
|
8
tests/integration/files/file/base/issue-1879/step-1.sls
Normal file
8
tests/integration/files/file/base/issue-1879/step-1.sls
Normal file
|
@ -0,0 +1,8 @@
|
|||
/tmp/salttest/issue-1879:
|
||||
|
||||
file.append:
|
||||
- text: |
|
||||
# set variable identifying the chroot you work in (used in the prompt below)
|
||||
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
|
||||
debian_chroot=$(cat /etc/debian_chroot)
|
||||
fi
|
8
tests/integration/files/file/base/issue-1879/step-2.sls
Normal file
8
tests/integration/files/file/base/issue-1879/step-2.sls
Normal file
|
@ -0,0 +1,8 @@
|
|||
/tmp/salttest/issue-1879:
|
||||
|
||||
file.append:
|
||||
- text: |
|
||||
# enable bash completion in interactive shells
|
||||
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
|
||||
. /etc/bash_completion
|
||||
fi
|
|
@ -1,4 +1,5 @@
|
|||
# Import python libs
|
||||
import os
|
||||
import integration
|
||||
|
||||
|
||||
|
@ -64,6 +65,26 @@ class StateModuleTest(integration.ModuleCase):
|
|||
'multiple state decs of the same type', sls
|
||||
)
|
||||
|
||||
def test_issue_1879_too_simple_contains_check(self):
|
||||
# Create the file
|
||||
self.run_function('state.sls', mods='issue-1879')
|
||||
# The first append
|
||||
self.run_function('state.sls', mods='issue-1879.step-1')
|
||||
# The seccond append
|
||||
self.run_function('state.sls', mods='issue-1879.step-2')
|
||||
# Does it match?
|
||||
self.assertMultiLineEqual("""\
|
||||
# set variable identifying the chroot you work in (used in the prompt below)
|
||||
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
|
||||
debian_chroot=$(cat /etc/debian_chroot)
|
||||
fi
|
||||
# enable bash completion in interactive shells
|
||||
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
|
||||
. /etc/bash_completion
|
||||
fi""", open("/tmp/salttest/issue-1879", "r").read())
|
||||
os.unlink('/tmp/salttest/issue-1879')
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from integration import run_tests
|
||||
|
|
Loading…
Add table
Reference in a new issue