Fix hang when running tests on OpenBSD by skipping two tests

Jeremy Evans jeremyevans0 at gmail.com
Tue Nov 15 16:19:34 EST 2011


On Tue, Nov 15, 2011 at 9:03 PM, Jeremy Evans <jeremyevans0 at gmail.com> wrote:
> openssl sha1 on OpenBSD doesn't just spit out the hash:
>
> $ openssl sha1 mocha.diff
> SHA1(mocha.diff)= 4ea47d3cf9e4f1858a298a8a9f5a5671422971d5
> $ sha1 -q mocha.diff
> 4ea47d3cf9e4f1858a298a8a9f5a5671422971d5

Here's a fix for t/test-lib.sh that handles unix socket paths where
you are running the regression tests for a long directory name.  I
didn't catch this earlier because the unix socket test only fails on
ruby 1.9 port on my system, since the path name is a little longer for
the ruby19 flavor than the unflavored ruby 1.8 port.

You probably want to use more robust name mangling if you choose to
fix this, my fix is simple but has corner cases where it breaks that
could be problematic.

Jeremy

--- t/test-lib.sh.orig  Thu Jan  1 01:00:00 1970
+++ t/test-lib.sh       Tue Nov 15 22:02:59 2011
@@ -38,20 +38,24 @@ rtmpfiles () {
        for id in "$@"
        do
                name=$id
-               _tmp=$t_pfx.$id
-               eval "$id=$_tmp"

                case $name in
                *fifo)
+                       _tmp=$t_pfx.$id
+                       eval "$id=$_tmp"
                        rm -f $_tmp
                        mkfifo $_tmp
                        T_RM_LIST="$T_RM_LIST $_tmp"
                        ;;
                *socket)
+                       _tmp=$(echo "$t_pfx.$id" | $RUBY -e 'print
$stdin.read(103)')
+                       eval "$id=$_tmp"
                        rm -f $_tmp
                        T_RM_LIST="$T_RM_LIST $_tmp"
                        ;;
                *)
+                       _tmp=$t_pfx.$id
+                       eval "$id=$_tmp"
                        > $_tmp
                        T_OK_RM_LIST="$T_OK_RM_LIST $_tmp"
                        ;;
@@ -101,6 +105,7 @@ unicorn_wait_start () {

 rsha1 () {
        _cmd="$(which sha1sum 2>/dev/null || :)"
+       test -n "$_cmd" || _cmd="$(which sha1 2>/dev/null || :) -q"
        test -n "$_cmd" || _cmd="$(which openssl 2>/dev/null || :) sha1"
        test "$_cmd" != " sha1" || _cmd="$(which gsha1sum 2>/dev/null || :)"


More information about the mongrel-unicorn mailing list