Cleanup buildout fake binary to be readable.

parent 1b45e7c7
...@@ -814,18 +814,23 @@ class TestSlapgridCPWithMasterWatchdog(MasterMixin, unittest.TestCase): ...@@ -814,18 +814,23 @@ class TestSlapgridCPWithMasterWatchdog(MasterMixin, unittest.TestCase):
partition = computer.instance_list[0] partition = computer.instance_list[0]
partition.requested_state = 'started' partition.requested_state = 'started'
RUN_CONTENT = textwrap.dedent("""\ # Content of run wrapper
#!/bin/sh WRAPPER_CONTENT = textwrap.dedent("""#!/bin/sh
touch ./launched
touch ./crashed
echo Failing
sleep 1
exit 111
""")
BUILDOUT_RUN_CONTENT = textwrap.dedent("""#!/bin/sh
mkdir -p etc/run && mkdir -p etc/run &&
echo "#!/bin/sh" > etc/run/daemon && echo "%s" >> etc/run/daemon &&
echo "touch launched
touch ./crashed; echo Failing; sleep 1; exit 111;
" >> etc/run/daemon &&
chmod 755 etc/run/daemon && chmod 755 etc/run/daemon &&
touch worked touch worked
""") """ % WRAPPER_CONTENT)
partition.software.setBuildout(RUN_CONTENT) partition.software.setBuildout(BUILDOUT_RUN_CONTENT)
self.assertEqual(self.grid.processComputerPartitionList(), slapgrid.SLAPGRID_SUCCESS) self.assertEqual(self.grid.processComputerPartitionList(), slapgrid.SLAPGRID_SUCCESS)
self.assertItemsEqual(os.listdir(self.instance_root), self.assertItemsEqual(os.listdir(self.instance_root),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment