Create puppet folder layout
* create fixtures directory that will contain manifests to run. * Add an empty scenario001.pp file to ensure our gate is properly working. This implementation is basic and is not definitive. It aims to scale-up later once we have multiple scenarios. Change-Id: I0149c7887c8e664ca895be8ce4df5f620c5c6d0c Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
b3358f78fa
commit
8348afb6fc
17
fixtures/scenario001.pp
Normal file
17
fixtures/scenario001.pp
Normal file
@ -0,0 +1,17 @@
|
||||
#
|
||||
# Copyright 2015 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
notice('Successful Puppet run')
|
31
run_tests.sh
31
run_tests.sh
@ -1,4 +1,4 @@
|
||||
#!/bin/bash -e
|
||||
#!/bin/bash -ex
|
||||
# Copyright 2015 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
@ -19,3 +19,32 @@ if [ $(id -u) != 0 ]; then
|
||||
fi
|
||||
|
||||
$SUDO ./install_modules.sh
|
||||
|
||||
PUPPET_ARGS="--detailed-exitcodes --verbose --color=false --debug"
|
||||
|
||||
function run_puppet() {
|
||||
local manifest=$1
|
||||
|
||||
$SUDO puppet apply $PUPPET_ARGS fixtures/${manifest}.pp
|
||||
local res=$?
|
||||
|
||||
return $res
|
||||
}
|
||||
|
||||
# Run puppet and assert something changes.
|
||||
set +e
|
||||
run_puppet scenario001
|
||||
RESULT=$?
|
||||
set -e
|
||||
if [ $RESULT -ne 2 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run puppet a second time and assert nothing changes.
|
||||
set +e
|
||||
run_puppet scenario001
|
||||
RESULT=$?
|
||||
set -e
|
||||
if [ $RESULT -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user