Run test_ordinals after update
authorRich Salz <rsalz@akamai.com>
Wed, 2 Dec 2015 17:20:49 +0000 (12:20 -0500)
committerRich Salz <rsalz@openssl.org>
Wed, 2 Dec 2015 17:40:38 +0000 (12:40 -0500)
Catch a common 'make update' failure: conflicting ordinals.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Makefile.org
test/recipes/01-test_ordinals.t [new file with mode: 0755]
test/recipes/90-test_ordinals.t [deleted file]

index 6cd20f87707fe3fe688ad4892c89eaa6b02cac51..08c700093abffe35e91fddc77129dbc4842a0248 100644 (file)
@@ -436,6 +436,9 @@ rehash.time: certs apps
 
 test:   tests
 
+test_ordinals:
+       $(MAKE) TESTS=test_ordinals test
+
 tests: rehash
        @(cd test && echo "testing..." && \
        $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
@@ -450,7 +453,7 @@ list-tests:
 report:
        @$(PERL) util/selftest.pl
 
-update: errors stacks util/libeay.num util/ssleay.num TABLE
+update: errors stacks util/libeay.num util/ssleay.num TABLE test_ordinals
        @set -e; target=update; $(RECURSIVE_BUILD_CMD)
 
 depend:
diff --git a/test/recipes/01-test_ordinals.t b/test/recipes/01-test_ordinals.t
new file mode 100755 (executable)
index 0000000..3e28641
--- /dev/null
@@ -0,0 +1,104 @@
+#!/usr/bin/perl
+# Written by Matt Caswell for the OpenSSL project.
+# ====================================================================
+# Copyright (c) 1998-2015 The OpenSSL Project.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+#
+# 3. All advertising materials mentioning features or use of this
+#    software must display the following acknowledgment:
+#    "This product includes software developed by the OpenSSL Project
+#    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+#
+# 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+#    endorse or promote products derived from this software without
+#    prior written permission. For written permission, please contact
+#    openssl-core@openssl.org.
+#
+# 5. Products derived from this software may not be called "OpenSSL"
+#    nor may "OpenSSL" appear in their names without prior written
+#    permission of the OpenSSL Project.
+#
+# 6. Redistributions of any form whatsoever must retain the following
+#    acknowledgment:
+#    "This product includes software developed by the OpenSSL Project
+#    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+#
+# THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+# OF THE POSSIBILITY OF SUCH DAMAGE.
+# ====================================================================
+#
+# This product includes cryptographic software written by Eric Young
+# (eay@cryptsoft.com).  This product includes software written by Tim
+# Hudson (tjh@cryptsoft.com).
+
+use strict;
+use OpenSSL::Test qw/:DEFAULT top_file/;
+
+setup("test_ordinals");
+
+plan tests => 2;
+
+ok(testordinals(top_file("util", "libeay.num")), "Test libeay.num");
+ok(testordinals(top_file("util", "ssleay.num")), "Test ssleay.num");
+
+sub testordinals
+{
+    my $filename = shift;
+    my $cnt = 0;
+    my $ret = 1;
+    my $qualifier = "";
+    my $newqual;
+    my $lastfunc = "";
+
+    open(my $fh, '<', $filename);
+    while (my $line = <$fh>) {
+        my @tokens = split(/( |\t|:)+/, $line);
+        #Check the line looks sane
+        if ($#tokens < 8 || $#tokens > 10) {
+            print STDERR "Invalid line:\n$line\n";
+            $ret = 0;
+            last;
+        }
+        if ($tokens[4] eq "NOEXIST") {
+            #Ignore this line
+            next;
+        }
+        #Some ordinals can be repeated, e.g. if one is VMS and another is !VMS
+        $newqual = $tokens[6];
+        $newqual =~ s/!//g;
+        if ($cnt > $tokens[2]
+                || ($cnt == $tokens[2] && ($qualifier ne $newqual
+                                           || $qualifier eq "FUNCTION"))) {
+            print STDERR "Invalid ordinal detected: ".$tokens[2]."\n";
+            $ret = 0;
+            last;
+        }
+        $cnt = $tokens[2];
+        $qualifier = $newqual;
+        $lastfunc = $tokens[0];
+    }
+    close($fh);
+
+    return $ret;
+}
diff --git a/test/recipes/90-test_ordinals.t b/test/recipes/90-test_ordinals.t
deleted file mode 100755 (executable)
index 3e28641..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/perl
-# Written by Matt Caswell for the OpenSSL project.
-# ====================================================================
-# Copyright (c) 1998-2015 The OpenSSL Project.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in
-#    the documentation and/or other materials provided with the
-#    distribution.
-#
-# 3. All advertising materials mentioning features or use of this
-#    software must display the following acknowledgment:
-#    "This product includes software developed by the OpenSSL Project
-#    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
-#
-# 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
-#    endorse or promote products derived from this software without
-#    prior written permission. For written permission, please contact
-#    openssl-core@openssl.org.
-#
-# 5. Products derived from this software may not be called "OpenSSL"
-#    nor may "OpenSSL" appear in their names without prior written
-#    permission of the OpenSSL Project.
-#
-# 6. Redistributions of any form whatsoever must retain the following
-#    acknowledgment:
-#    "This product includes software developed by the OpenSSL Project
-#    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
-#
-# THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
-# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
-# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-# OF THE POSSIBILITY OF SUCH DAMAGE.
-# ====================================================================
-#
-# This product includes cryptographic software written by Eric Young
-# (eay@cryptsoft.com).  This product includes software written by Tim
-# Hudson (tjh@cryptsoft.com).
-
-use strict;
-use OpenSSL::Test qw/:DEFAULT top_file/;
-
-setup("test_ordinals");
-
-plan tests => 2;
-
-ok(testordinals(top_file("util", "libeay.num")), "Test libeay.num");
-ok(testordinals(top_file("util", "ssleay.num")), "Test ssleay.num");
-
-sub testordinals
-{
-    my $filename = shift;
-    my $cnt = 0;
-    my $ret = 1;
-    my $qualifier = "";
-    my $newqual;
-    my $lastfunc = "";
-
-    open(my $fh, '<', $filename);
-    while (my $line = <$fh>) {
-        my @tokens = split(/( |\t|:)+/, $line);
-        #Check the line looks sane
-        if ($#tokens < 8 || $#tokens > 10) {
-            print STDERR "Invalid line:\n$line\n";
-            $ret = 0;
-            last;
-        }
-        if ($tokens[4] eq "NOEXIST") {
-            #Ignore this line
-            next;
-        }
-        #Some ordinals can be repeated, e.g. if one is VMS and another is !VMS
-        $newqual = $tokens[6];
-        $newqual =~ s/!//g;
-        if ($cnt > $tokens[2]
-                || ($cnt == $tokens[2] && ($qualifier ne $newqual
-                                           || $qualifier eq "FUNCTION"))) {
-            print STDERR "Invalid ordinal detected: ".$tokens[2]."\n";
-            $ret = 0;
-            last;
-        }
-        $cnt = $tokens[2];
-        $qualifier = $newqual;
-        $lastfunc = $tokens[0];
-    }
-    close($fh);
-
-    return $ret;
-}