summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2013-06-22 16:16:00 -0400
committerSimo Sorce <simo@redhat.com>2013-07-13 16:33:13 -0400
commit677ab0a79147f7606c73b63ecad91f8b1e7b63c1 (patch)
treef5402897d71f668564aa1f105ff6309198a6c1dd /tests
downloadgss-ntlmssp-677ab0a79147f7606c73b63ecad91f8b1e7b63c1.tar.gz
gss-ntlmssp-677ab0a79147f7606c73b63ecad91f8b1e7b63c1.tar.xz
gss-ntlmssp-677ab0a79147f7606c73b63ecad91f8b1e7b63c1.zip
Scheleton to start bulding the GSS-NTLMSSP project.
Diffstat (limited to 'tests')
-rw-r--r--tests/ntlmssptest.c25
-rwxr-xr-xtests/scripts/dlopen.sh76
2 files changed, 101 insertions, 0 deletions
diff --git a/tests/ntlmssptest.c b/tests/ntlmssptest.c
new file mode 100644
index 0000000..f5785d6
--- /dev/null
+++ b/tests/ntlmssptest.c
@@ -0,0 +1,25 @@
+/*
+ GSS-NTLM
+
+ Copyright (C) 2013 Simo Sorce <simo@samba.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "config.h"
+
+int main(int argc, const char *argv[])
+{
+ return 0;
+}
diff --git a/tests/scripts/dlopen.sh b/tests/scripts/dlopen.sh
new file mode 100755
index 0000000..890cc39
--- /dev/null
+++ b/tests/scripts/dlopen.sh
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+test -n "$TMPDIR" || exit 1
+tempdir="$TMPDIR/dlopentest"
+mkdir -p $tempdir
+cat >> $tempdir/dlopen.c << _EOF
+#include <dlfcn.h>
+#include <stdio.h>
+#include <limits.h>
+#include <sys/stat.h>
+/* Simple program to see if dlopen() would succeed. */
+int main(int argc, char **argv)
+{
+ int i;
+ struct stat st;
+ char buf[PATH_MAX];
+ for (i = 1; i < argc; i++) {
+ if (dlopen(argv[i], RTLD_NOW)) {
+ fprintf(stdout, "dlopen() of \"%s\" succeeded.\n",
+ argv[i]);
+ } else {
+ snprintf(buf, sizeof(buf), "./%s", argv[i]);
+ if ((stat(buf, &st) == 0) && dlopen(buf, RTLD_NOW)) {
+ fprintf(stdout, "dlopen() of \"./%s\" "
+ "succeeded.\n", argv[i]);
+ } else {
+ fprintf(stdout, "dlopen() of \"%s\" failed: "
+ "%s\n", argv[i], dlerror());
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+_EOF
+
+for arg in $@ ; do
+ case "$arg" in
+ "")
+ ;;
+ -I*|-D*|-f*|-m*|-g*|-O*|-W*)
+ cflags="$cflags $arg"
+ ;;
+ -l*|-L*)
+ ldflags="$ldflags $arg"
+ ;;
+ /*)
+ modules="$modules $arg"
+ ;;
+ *)
+ modules="$modules $arg"
+ ;;
+ esac
+done
+
+${CC:-gcc} $RPM_OPT_FLAGS $CFLAGS -o $tempdir/dlopen $cflags $tempdir/dlopen.c $ldflags -ldl
+
+retval=0
+for module in $modules ; do
+ case "$module" in
+ "")
+ ;;
+ /*)
+ $tempdir/dlopen "$module"
+ retval=$?
+ ;;
+ *)
+ $tempdir/dlopen ./"$module"
+ retval=$?
+ ;;
+ esac
+done
+
+rm -f $tempdir/dlopen $tempdir/dlopen.c
+rmdir $tempdir
+exit $retval