diff --git a/cloudinitd/bootfabtasks.py b/cloudinitd/bootfabtasks.py index 87b0d55..160b8bf 100644 --- a/cloudinitd/bootfabtasks.py +++ b/cloudinitd/bootfabtasks.py @@ -92,6 +92,7 @@ def readypgm(pgm=None, args=None, stagedir=None, local_exe=None): if local_exe: put_pgm(pgm, destpgm) os.chmod(destpgm, 0755) + os.chdir(stagedir) else: put_pgm(pgm, destpgm, mode=0755) diff --git a/tests/plans/localhost/bootpgm.sh b/tests/plans/localhost/bootpgm.sh index 8c3cbfc..dbe7492 100644 --- a/tests/plans/localhost/bootpgm.sh +++ b/tests/plans/localhost/bootpgm.sh @@ -1,3 +1,14 @@ #!/bin/bash +if [ ! -e bootconf.json ]; then + echo "The boot conf file does not exist!" + pwd + exit 1 +fi +if [ ! -e bootenv.sh ]; then + echo "The boot conf file does not exist!" + pwd + exit 1 +fi + exit 0 diff --git a/tests/plans/localhost/test-level1.conf b/tests/plans/localhost/test-level1.conf index 9fd933c..1e398ef 100644 --- a/tests/plans/localhost/test-level1.conf +++ b/tests/plans/localhost/test-level1.conf @@ -1,6 +1,8 @@ [svc-sampleservice] bootpgm: bootpgm.sh -readypgm: sampletest.sh -terminatepgm: sampletest.sh +readypgm: bootpgm.sh +terminatepgm: bootpgm.sh hostname: localhost local_exe: True +bootconf: bootconf.json +deps: deps.conf diff --git a/tests/plans/localhostexe/bootconf.json b/tests/plans/localhostexe/bootconf.json new file mode 100644 index 0000000..4d70afb --- /dev/null +++ b/tests/plans/localhostexe/bootconf.json @@ -0,0 +1 @@ +{"message":"${message}"} diff --git a/tests/plans/localhostexe/bootpgm.sh b/tests/plans/localhostexe/bootpgm.sh index 8c3cbfc..dbe7492 100644 --- a/tests/plans/localhostexe/bootpgm.sh +++ b/tests/plans/localhostexe/bootpgm.sh @@ -1,3 +1,14 @@ #!/bin/bash +if [ ! -e bootconf.json ]; then + echo "The boot conf file does not exist!" + pwd + exit 1 +fi +if [ ! -e bootenv.sh ]; then + echo "The boot conf file does not exist!" + pwd + exit 1 +fi + exit 0 diff --git a/tests/plans/localhostexe/deps.conf b/tests/plans/localhostexe/deps.conf new file mode 100644 index 0000000..9ba5a06 --- /dev/null +++ b/tests/plans/localhostexe/deps.conf @@ -0,0 +1,3 @@ +[deps] +message: hello world + diff --git a/tests/plans/localhostexe/sampletest.sh b/tests/plans/localhostexe/sampletest.sh deleted file mode 100644 index 8c3cbfc..0000000 --- a/tests/plans/localhostexe/sampletest.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -exit 0 diff --git a/tests/plans/localhostexe/test-level1.conf b/tests/plans/localhostexe/test-level1.conf index 9fd933c..1e398ef 100644 --- a/tests/plans/localhostexe/test-level1.conf +++ b/tests/plans/localhostexe/test-level1.conf @@ -1,6 +1,8 @@ [svc-sampleservice] bootpgm: bootpgm.sh -readypgm: sampletest.sh -terminatepgm: sampletest.sh +readypgm: bootpgm.sh +terminatepgm: bootpgm.sh hostname: localhost local_exe: True +bootconf: bootconf.json +deps: deps.conf