From aea9ddf21eedc566afa01892778081425fc131ac Mon Sep 17 00:00:00 2001 From: Paul Joseph Davis Date: Tue, 17 May 2011 23:14:25 +0000 Subject: Backported os daemon tests from trunk. This reduces the chance that these tests fail due to timing differences by avoding booting of an Erlang VM as an os daemon. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1104622 13f79535-47bb-0310-9956-ffa450edef68 --- test/etap/172-os-daemon-errors.1.es | 22 ---------------------- test/etap/172-os-daemon-errors.1.sh | 17 +++++++++++++++++ test/etap/172-os-daemon-errors.2.es | 16 ---------------- test/etap/172-os-daemon-errors.2.sh | 15 +++++++++++++++ test/etap/172-os-daemon-errors.3.es | 17 ----------------- test/etap/172-os-daemon-errors.3.sh | 15 +++++++++++++++ test/etap/172-os-daemon-errors.4.es | 17 ----------------- test/etap/172-os-daemon-errors.4.sh | 15 +++++++++++++++ test/etap/172-os-daemon-errors.t | 8 ++++---- test/etap/Makefile.am | 8 ++++---- 10 files changed, 70 insertions(+), 80 deletions(-) delete mode 100644 test/etap/172-os-daemon-errors.1.es create mode 100644 test/etap/172-os-daemon-errors.1.sh delete mode 100755 test/etap/172-os-daemon-errors.2.es create mode 100755 test/etap/172-os-daemon-errors.2.sh delete mode 100755 test/etap/172-os-daemon-errors.3.es create mode 100755 test/etap/172-os-daemon-errors.3.sh delete mode 100755 test/etap/172-os-daemon-errors.4.es create mode 100755 test/etap/172-os-daemon-errors.4.sh (limited to 'test') diff --git a/test/etap/172-os-daemon-errors.1.es b/test/etap/172-os-daemon-errors.1.es deleted file mode 100644 index a9defba1..00000000 --- a/test/etap/172-os-daemon-errors.1.es +++ /dev/null @@ -1,22 +0,0 @@ -#! /usr/bin/env escript - -% 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. - -% Please do not make this file executable as that's the error being tested. - -loop() -> - timer:sleep(5000), - loop(). - -main([]) -> - loop(). diff --git a/test/etap/172-os-daemon-errors.1.sh b/test/etap/172-os-daemon-errors.1.sh new file mode 100644 index 00000000..345c8b40 --- /dev/null +++ b/test/etap/172-os-daemon-errors.1.sh @@ -0,0 +1,17 @@ +#!/bin/sh -e +# +# 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. +# +# Please do not make this file executable as that's the error being tested. + +sleep 5 diff --git a/test/etap/172-os-daemon-errors.2.es b/test/etap/172-os-daemon-errors.2.es deleted file mode 100755 index 52de0401..00000000 --- a/test/etap/172-os-daemon-errors.2.es +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/env escript - -% 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. - -main([]) -> - init:stop(). diff --git a/test/etap/172-os-daemon-errors.2.sh b/test/etap/172-os-daemon-errors.2.sh new file mode 100755 index 00000000..256ee793 --- /dev/null +++ b/test/etap/172-os-daemon-errors.2.sh @@ -0,0 +1,15 @@ +#!/bin/sh -e +# +# 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. + +exit 1 diff --git a/test/etap/172-os-daemon-errors.3.es b/test/etap/172-os-daemon-errors.3.es deleted file mode 100755 index 64229800..00000000 --- a/test/etap/172-os-daemon-errors.3.es +++ /dev/null @@ -1,17 +0,0 @@ -#! /usr/bin/env escript - -% 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. - -main([]) -> - timer:sleep(1000), - init:stop(). diff --git a/test/etap/172-os-daemon-errors.3.sh b/test/etap/172-os-daemon-errors.3.sh new file mode 100755 index 00000000..f5a13684 --- /dev/null +++ b/test/etap/172-os-daemon-errors.3.sh @@ -0,0 +1,15 @@ +#!/bin/sh -e +# +# 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. + +sleep 1 diff --git a/test/etap/172-os-daemon-errors.4.es b/test/etap/172-os-daemon-errors.4.es deleted file mode 100755 index 577f3410..00000000 --- a/test/etap/172-os-daemon-errors.4.es +++ /dev/null @@ -1,17 +0,0 @@ -#! /usr/bin/env escript - -% 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. - -main([]) -> - timer:sleep(2000), - init:stop(). diff --git a/test/etap/172-os-daemon-errors.4.sh b/test/etap/172-os-daemon-errors.4.sh new file mode 100755 index 00000000..5bc10e83 --- /dev/null +++ b/test/etap/172-os-daemon-errors.4.sh @@ -0,0 +1,15 @@ +#!/bin/sh -e +# +# 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. + +sleep 2 diff --git a/test/etap/172-os-daemon-errors.t b/test/etap/172-os-daemon-errors.t index 287a0812..bde5c6ff 100755 --- a/test/etap/172-os-daemon-errors.t +++ b/test/etap/172-os-daemon-errors.t @@ -30,16 +30,16 @@ config_files() -> ]). bad_perms() -> - test_util:source_file("test/etap/172-os-daemon-errors.1.es"). + test_util:source_file("test/etap/172-os-daemon-errors.1.sh"). die_on_boot() -> - test_util:source_file("test/etap/172-os-daemon-errors.2.es"). + test_util:source_file("test/etap/172-os-daemon-errors.2.sh"). die_quickly() -> - test_util:source_file("test/etap/172-os-daemon-errors.3.es"). + test_util:source_file("test/etap/172-os-daemon-errors.3.sh"). can_reboot() -> - test_util:source_file("test/etap/172-os-daemon-errors.4.es"). + test_util:source_file("test/etap/172-os-daemon-errors.4.sh"). main(_) -> test_util:init_code_path(), diff --git a/test/etap/Makefile.am b/test/etap/Makefile.am index 1b14b9e1..ce52d430 100644 --- a/test/etap/Makefile.am +++ b/test/etap/Makefile.am @@ -77,10 +77,10 @@ EXTRA_DIST = \ 170-os-daemons.t \ 171-os-daemons-config.es \ 171-os-daemons-config.t \ - 172-os-daemon-errors.1.es \ - 172-os-daemon-errors.2.es \ - 172-os-daemon-errors.3.es \ - 172-os-daemon-errors.4.es \ + 172-os-daemon-errors.1.sh \ + 172-os-daemon-errors.2.sh \ + 172-os-daemon-errors.3.sh \ + 172-os-daemon-errors.4.sh \ 172-os-daemon-errors.t \ 173-os-daemon-cfg-register.t \ 180-http-proxy.ini \ -- cgit v1.2.3