couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1066932 - /couchdb/trunk/test/etap/
Date Thu, 03 Feb 2011 20:02:58 GMT
Author: davisp
Date: Thu Feb  3 20:02:57 2011
New Revision: 1066932

URL: http://svn.apache.org/viewvc?rev=1066932&view=rev
Log:
Fix etap test errors during make distcheck.

  * Updated shebang lines to use /bin/sh -e
  * Fixed config file paths for VPATH builds
  * Updated test/etap/Makefile.am to have correct paths
    for the new shell scripts and random_port.ini


Modified:
    couchdb/trunk/test/etap/112-replication-missing-revs.t
    couchdb/trunk/test/etap/172-os-daemon-errors.1.sh
    couchdb/trunk/test/etap/172-os-daemon-errors.2.sh
    couchdb/trunk/test/etap/172-os-daemon-errors.3.sh
    couchdb/trunk/test/etap/172-os-daemon-errors.4.sh
    couchdb/trunk/test/etap/173-os-daemon-cfg-register.t
    couchdb/trunk/test/etap/180-http-proxy.t
    couchdb/trunk/test/etap/Makefile.am
    couchdb/trunk/test/etap/test_util.erl.in

Modified: couchdb/trunk/test/etap/112-replication-missing-revs.t
URL: http://svn.apache.org/viewvc/couchdb/trunk/test/etap/112-replication-missing-revs.t?rev=1066932&r1=1066931&r2=1066932&view=diff
==============================================================================
--- couchdb/trunk/test/etap/112-replication-missing-revs.t (original)
+++ couchdb/trunk/test/etap/112-replication-missing-revs.t Thu Feb  3 20:02:57 2011
@@ -39,13 +39,6 @@
     conn = nil
 }).
 
-config_files() ->
-    lists:map(fun test_util:build_file/1, [
-        "etc/couchdb/default_dev.ini",
-        "etc/couchdb/local_dev.ini",
-        "test/etap/random_port.ini"
-    ]).
-
 main(_) ->
     test_util:init_code_path(),
     
@@ -60,7 +53,7 @@ main(_) ->
     ok.
 
 test() ->
-    couch_server_sup:start_link(config_files()),
+    couch_server_sup:start_link(test_util:config_files()),
     ibrowse:start(),
     crypto:start(),
 

Modified: couchdb/trunk/test/etap/172-os-daemon-errors.1.sh
URL: http://svn.apache.org/viewvc/couchdb/trunk/test/etap/172-os-daemon-errors.1.sh?rev=1066932&r1=1066931&r2=1066932&view=diff
==============================================================================
--- couchdb/trunk/test/etap/172-os-daemon-errors.1.sh (original)
+++ couchdb/trunk/test/etap/172-os-daemon-errors.1.sh Thu Feb  3 20:02:57 2011
@@ -1,4 +1,4 @@
-#! /usr/bin/env bash -e
+#!/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
@@ -14,4 +14,4 @@
 # 
 # Please do not make this file executable as that's the error being tested.
 
-sleep 5
\ No newline at end of file
+sleep 5

Modified: couchdb/trunk/test/etap/172-os-daemon-errors.2.sh
URL: http://svn.apache.org/viewvc/couchdb/trunk/test/etap/172-os-daemon-errors.2.sh?rev=1066932&r1=1066931&r2=1066932&view=diff
==============================================================================
--- couchdb/trunk/test/etap/172-os-daemon-errors.2.sh (original)
+++ couchdb/trunk/test/etap/172-os-daemon-errors.2.sh Thu Feb  3 20:02:57 2011
@@ -1,4 +1,4 @@
-#! /usr/bin/env bash -e
+#!/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
@@ -12,4 +12,4 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 
-exit 1
\ No newline at end of file
+exit 1

Modified: couchdb/trunk/test/etap/172-os-daemon-errors.3.sh
URL: http://svn.apache.org/viewvc/couchdb/trunk/test/etap/172-os-daemon-errors.3.sh?rev=1066932&r1=1066931&r2=1066932&view=diff
==============================================================================
--- couchdb/trunk/test/etap/172-os-daemon-errors.3.sh (original)
+++ couchdb/trunk/test/etap/172-os-daemon-errors.3.sh Thu Feb  3 20:02:57 2011
@@ -1,4 +1,4 @@
-#! /usr/bin/env bash -e
+#!/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
@@ -12,4 +12,4 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 
-sleep 1
\ No newline at end of file
+sleep 1

Modified: couchdb/trunk/test/etap/172-os-daemon-errors.4.sh
URL: http://svn.apache.org/viewvc/couchdb/trunk/test/etap/172-os-daemon-errors.4.sh?rev=1066932&r1=1066931&r2=1066932&view=diff
==============================================================================
--- couchdb/trunk/test/etap/172-os-daemon-errors.4.sh (original)
+++ couchdb/trunk/test/etap/172-os-daemon-errors.4.sh Thu Feb  3 20:02:57 2011
@@ -1,4 +1,4 @@
-#! /usr/bin/env bash -e
+#!/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
@@ -12,4 +12,4 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 
-sleep 2
\ No newline at end of file
+sleep 2

Modified: couchdb/trunk/test/etap/173-os-daemon-cfg-register.t
URL: http://svn.apache.org/viewvc/couchdb/trunk/test/etap/173-os-daemon-cfg-register.t?rev=1066932&r1=1066931&r2=1066932&view=diff
==============================================================================
--- couchdb/trunk/test/etap/173-os-daemon-cfg-register.t (original)
+++ couchdb/trunk/test/etap/173-os-daemon-cfg-register.t Thu Feb  3 20:02:57 2011
@@ -51,32 +51,55 @@ test() ->
     
     etap:diag("Booting the daemon"),
     couch_config:set("os_daemons", daemon_name(), DaemonCmd, false),
-    timer:sleep(1000),
+    wait_for_start(10),
     {ok, [D1]} = couch_os_daemons:info([table]),
     check_daemon(D1, running),
     
     etap:diag("Daemon restarts when section changes."),
     couch_config:set("s1", "k", "foo", false),
-    timer:sleep(1000),
+    wait_for_restart(10),
     {ok, [D2]} = couch_os_daemons:info([table]),
     check_daemon(D2, running),
     etap:isnt(D2#daemon.kill, D1#daemon.kill, "Kill command shows restart."),
 
     etap:diag("Daemon doesn't restart for ignored section key."),
     couch_config:set("s2", "k2", "baz", false),
-    timer:sleep(1000),
+    timer:sleep(1000), % Message travel time.
     {ok, [D3]} = couch_os_daemons:info([table]),
     etap:is(D3, D2, "Same daemon info after ignored config change."),
     
     etap:diag("Daemon restarts for specific section/key pairs."),
     couch_config:set("s2", "k", "bingo", false),
-    timer:sleep(1000),
+    wait_for_restart(10),
     {ok, [D4]} = couch_os_daemons:info([table]),
     check_daemon(D4, running),
     etap:isnt(D4#daemon.kill, D3#daemon.kill, "Kill command changed again."),
     
     ok.
 
+wait_for_start(0) ->
+    throw({error, wait_for_start});
+wait_for_start(N) ->
+    case couch_os_daemons:info([table]) of
+        {ok, []} ->
+            timer:sleep(200),
+            wait_for_start(N-1);
+        _ ->
+            timer:sleep(1000)
+    end.
+
+wait_for_restart(0) ->
+    throw({error, wait_for_restart});
+wait_for_restart(N) ->
+    {ok, [D]} = couch_os_daemons:info([table]),
+    case D#daemon.status of
+        restarting ->
+            timer:sleep(200),
+            wait_for_restart(N-1);
+        _ ->
+            timer:sleep(1000)
+    end.
+
 check_daemon(D, Status) ->
     BaseName = filename:basename(daemon_cmd()) ++ " 2> /dev/null",
     BaseLen = length(BaseName),

Modified: couchdb/trunk/test/etap/180-http-proxy.t
URL: http://svn.apache.org/viewvc/couchdb/trunk/test/etap/180-http-proxy.t?rev=1066932&r1=1066931&r2=1066932&view=diff
==============================================================================
--- couchdb/trunk/test/etap/180-http-proxy.t (original)
+++ couchdb/trunk/test/etap/180-http-proxy.t Thu Feb  3 20:02:57 2011
@@ -67,10 +67,8 @@ check_request(Name, Req, Remote, Local) 
     Resp.
 
 test() ->
-    couch_server_sup:start_link([
-        test_util:build_file("test/etap/180-http-proxy.ini") |
-        test_util:config_files()
-    ]),
+    ExtraConfig = [test_util:source_file("test/etap/180-http-proxy.ini")],
+    couch_server_sup:start_link(test_util:config_files() ++ ExtraConfig),
     ibrowse:start(),
     crypto:start(),
 

Modified: couchdb/trunk/test/etap/Makefile.am
URL: http://svn.apache.org/viewvc/couchdb/trunk/test/etap/Makefile.am?rev=1066932&r1=1066931&r2=1066932&view=diff
==============================================================================
--- couchdb/trunk/test/etap/Makefile.am (original)
+++ couchdb/trunk/test/etap/Makefile.am Thu Feb  3 20:02:57 2011
@@ -28,6 +28,7 @@ DISTCLEANFILES = temp.*
 EXTRA_DIST = \
 	run.tpl \
 	test_web.erl \
+    random_port.ini \
     001-load.t \
     002-icu-driver.t \
     010-file-basics.t \
@@ -72,10 +73,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.es \
 	173-os-daemon-cfg-register.t \

Modified: couchdb/trunk/test/etap/test_util.erl.in
URL: http://svn.apache.org/viewvc/couchdb/trunk/test/etap/test_util.erl.in?rev=1066932&r1=1066931&r2=1066932&view=diff
==============================================================================
--- couchdb/trunk/test/etap/test_util.erl.in (original)
+++ couchdb/trunk/test/etap/test_util.erl.in Thu Feb  3 20:02:57 2011
@@ -34,8 +34,8 @@ build_file(Name) ->
     filename:join([builddir(), Name]).
 
 config_files() ->
-    lists:map(fun build_file/1, [
-        "etc/couchdb/default_dev.ini",
-        "etc/couchdb/local_dev.ini",
-        "test/etap/random_port.ini"
-    ]).
+    [
+        build_file("etc/couchdb/default_dev.ini"),
+        build_file("etc/couchdb/local_dev.ini"),
+        source_file("test/etap/random_port.ini")
+    ].



Mime
View raw message