Skip to content

Commit

Permalink
Move spec/{drivers, setup, util} to lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Robinson committed Jul 26, 2010
1 parent 50980e8 commit 633bcc7
Show file tree
Hide file tree
Showing 24 changed files with 23 additions and 24 deletions.
3 changes: 1 addition & 2 deletions README
Expand Up @@ -18,8 +18,7 @@ An example is provided which assumes puppet and facter exist in /opt/puppetlabs
Writing specifications: Writing specifications:
* specification scripts should be written in BASH * specification scripts should be written in BASH
* Expect the current working directory to be where the Makefile lives. * Expect the current working directory to be where the Makefile lives.
* The script should source spec/util.sh * The script should source lib/setup.sh
* The script should source spec/setup.sh
* They should return $EXIT_FAIL on a test failure. * They should return $EXIT_FAIL on a test failure.
* The should return 0 or $EXIT_OK on test success. * The should return 0 or $EXIT_OK on test success.
* Any other exit code is treated as a testing error (not failure) * Any other exit code is treated as a testing error (not failure)
Expand Down
2 changes: 1 addition & 1 deletion spec/drivers.sh → lib/drivers.sh
@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
source spec/util.sh source lib/util.sh


driver_standalone() { driver_standalone() {
execute_manifest() { execute_manifest() {
Expand Down
2 changes: 1 addition & 1 deletion spec/setup.sh → lib/setup.sh
@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash


source spec/drivers.sh source lib/drivers.sh
env_driver env_driver
source local_setup.sh source local_setup.sh
File renamed without changes.
2 changes: 1 addition & 1 deletion spec/file_hello_world_spec.sh
@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash


set -u set -u
source spec/setup.sh source lib/setup.sh
set -e set -e


execute_manifest <<PP execute_manifest <<PP
Expand Down
2 changes: 1 addition & 1 deletion spec/puppet_agent_should_connect_to_the_master_spec.sh
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash


source spec/setup.sh source lib/setup.sh


start_puppet_master start_puppet_master


Expand Down
2 changes: 1 addition & 1 deletion spec/puppet_master_should_open_a_port_spec.sh
@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
set -u set -u
source spec/setup.sh source lib/setup.sh


PORT=18140 PORT=18140


Expand Down
2 changes: 1 addition & 1 deletion spec/resource/host/should_query_all_spec.sh
@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
source spec/setup.sh source lib/setup.sh


backup_file /etc/hosts backup_file /etc/hosts


Expand Down
2 changes: 1 addition & 1 deletion spec/resource/host/should_query_spec.sh
@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
source spec/setup.sh source lib/setup.sh


backup_file /etc/hosts backup_file /etc/hosts


Expand Down
2 changes: 1 addition & 1 deletion spec/resource/package/should_install_spec.sh
Expand Up @@ -3,7 +3,7 @@
set -e set -e
set -u set -u


source spec/setup.sh source lib/setup.sh


if ! which rpm ; then NOT_APPLICABLE ; fi if ! which rpm ; then NOT_APPLICABLE ; fi


Expand Down
2 changes: 1 addition & 1 deletion spec/resource/service/should_list_all_enabled_spec.sh
Expand Up @@ -9,7 +9,7 @@
# be marked pending. # be marked pending.


set -u set -u
source spec/setup.sh source lib/setup.sh
set -e set -e


# count ralshes enabled services # count ralshes enabled services
Expand Down
2 changes: 1 addition & 1 deletion spec/resource/user/should_create_with_gid_spec.sh
Expand Up @@ -3,7 +3,7 @@
# verifies that puppet resource creates a user and assigns the correct group # verifies that puppet resource creates a user and assigns the correct group
# #
set -u set -u
source spec/setup.sh source lib/setup.sh
set -e set -e


# preconditions # preconditions
Expand Down
2 changes: 1 addition & 1 deletion spec/settings_section_deprecation_spec.sh
Expand Up @@ -5,7 +5,7 @@


set -u set -u


source spec/setup.sh source lib/setup.sh


driver_master_and_agent_locally_using_old_executables driver_master_and_agent_locally_using_old_executables


Expand Down
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash


source spec/setup.sh source lib/setup.sh


puppet kick hostname1 | tee /tmp/puppet-kick-$$.txt puppet kick hostname1 | tee /tmp/puppet-kick-$$.txt


Expand Down
2 changes: 1 addition & 1 deletion spec/ticket_3656_requiring_multiple_resources.sh
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash


source spec/setup.sh source lib/setup.sh


execute_manifest <<'PP' execute_manifest <<'PP'
notify { 'foo': notify { 'foo':
Expand Down
2 changes: 1 addition & 1 deletion spec/ticket_3961_puppet_ca_should_produce_certs_spec.sh
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash


source spec/setup.sh source lib/setup.sh


puppet cert --trace --generate test01.domain.tld --ssldir=/tmp/puppet-ssl-$$ --debug --verbose puppet cert --trace --generate test01.domain.tld --ssldir=/tmp/puppet-ssl-$$ --debug --verbose


Expand Down
2 changes: 1 addition & 1 deletion spec/ticket_4059_ralsh_can_change_settings_spec.sh
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash


source spec/setup.sh source lib/setup.sh


puppet resource host example.com ensure=present ip=127.0.0.1 target=/tmp/hosts-$$ --trace puppet resource host example.com ensure=present ip=127.0.0.1 target=/tmp/hosts-$$ --trace


Expand Down
2 changes: 1 addition & 1 deletion spec/ticket_4090_store_reports.sh
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash


source spec/setup.sh source lib/setup.sh
driver_master_and_agent_locally_using_old_executables driver_master_and_agent_locally_using_old_executables


puppet_conf <<'CONF' puppet_conf <<'CONF'
Expand Down
2 changes: 1 addition & 1 deletion spec/ticket_4149_parseonly_should_not_fail_spec.sh
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash


source spec/setup.sh source lib/setup.sh
driver_standalone_using_files driver_standalone_using_files


execute_manifest --parseonly <<PP execute_manifest --parseonly <<PP
Expand Down
Expand Up @@ -18,7 +18,7 @@
set -e set -e
set -u set -u


source spec/setup.sh source lib/setup.sh
driver_standalone_using_files driver_standalone_using_files


execute_manifest <<PP execute_manifest <<PP
Expand Down
2 changes: 1 addition & 1 deletion spec/ticket_4220_autoloading_init.pp_from_a_module_spec.sh
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash


source spec/setup.sh source lib/setup.sh
use_driver "master_and_agent_locally" use_driver "master_and_agent_locally"


module_file "ssh/manifests/init.pp" <<'INIT' module_file "ssh/manifests/init.pp" <<'INIT'
Expand Down
2 changes: 1 addition & 1 deletion spec/ticket_4233_resource_with_a_newline_spec.sh
Expand Up @@ -7,7 +7,7 @@


set -u set -u


source spec/setup.sh source lib/setup.sh


# JJM We expect 2.6.0rc3 to return an error # JJM We expect 2.6.0rc3 to return an error
# and 2.6.0 final to not return an error line. # and 2.6.0 final to not return an error line.
Expand Down
Expand Up @@ -6,7 +6,7 @@


set -e set -e
set -u set -u
source spec/setup.sh source lib/setup.sh
if execute_manifest <<'EOF' if execute_manifest <<'EOF'
$foo='abc' $foo='abc'
if $foo != regsubst($foo,'abc','def') { if $foo != regsubst($foo,'abc','def') {
Expand Down
Expand Up @@ -10,7 +10,7 @@
# #


set -u set -u
source spec/setup.sh source lib/setup.sh


OUTPUT="/tmp/puppet-$$.out" OUTPUT="/tmp/puppet-$$.out"


Expand Down

0 comments on commit 633bcc7

Please sign in to comment.