From: <svn...@op...> - 2009-03-30 18:31:50
|
Author: scriptor Date: Mon Mar 30 20:31:44 2009 New Revision: 5471 URL: http://www.opensync.org/changeset/5471 Log: Additional tests using osynctool instead of osyncplugin. This way libopensync exit errors get detected, as well. Which is not possible with osyncplugin. The LDAP configuration file used by the test scripts can now be configured in test.conf (variable $CFG). Note: The $AUTH variable is used by the libldap utilities only. It must correspond with the authentication settings in the LDAP configuration file (variable $CFG). Or, at least both authentication settings must lead to write access to the LDAP server (so two different methods are very well possible). Added: plugins/ldap-sync/tests/check_osynctool1 (contents, props changed) plugins/ldap-sync/tests/check_osynctool2 (contents, props changed) Added: plugins/ldap-sync/tests/check_osynctool1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_osynctool1 Mon Mar 30 20:31:44 2009 (r5471) @@ -0,0 +1,22 @@ +#!/bin/bash + + +FILE=$0 +OSYNCTOOL=$(which osynctool 2>/dev/null) +if test ! -f "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could be found, but it is not executable. Exiting." + exit 1 +fi + + +$OSYNCTOOL --listplugins | grep -q "ldap-sync" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldap-sync was not included in pluginlist. Exiting." + exit 1 +fi Added: plugins/ldap-sync/tests/check_osynctool2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_osynctool2 Mon Mar 30 20:31:44 2009 (r5471) @@ -0,0 +1,79 @@ +#!/bin/bash + + +FILE=$0 +OSYNCTOOL=$(which osynctool 2>/dev/null) +if test ! -f "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could be found, but it is not executable. Exiting." + exit 1 +fi + + +$OSYNCTOOL --listformats | grep -q "ldap-evolutionperson" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldap-evolutionperson was not included in formatlist. Exiting." + exit 1 +fi + +$OSYNCTOOL --listformats | grep -q "ldap-inetorgperson" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldap-inetorgperson was not included in formatlist. Exiting." + exit 1 +fi + +$OSYNCTOOL --listformats | grep -q "ldap-event" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldap-event was not included in formatlist. Exiting." + exit 1 +fi + +$OSYNCTOOL --listformats | grep -q "ldap-todo" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldap-todo was not included in formatlist. Exiting." + exit 1 +fi + +$OSYNCTOOL --listformats | grep -q "ldap-note" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldap-note was not included in formatlist. Exiting." + exit 1 +fi + +$OSYNCTOOL --listformats | grep -q "xmlformat-contact$" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: xmlformat-contact was not included in formatlist. Exiting." + exit 1 +fi + +$OSYNCTOOL --listformats | grep -q "xmlformat-event$" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: xmlformat-event was not included in formatlist. Exiting." + exit 1 +fi + +$OSYNCTOOL --listformats | grep -q "xmlformat-todo$" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: xmlformat-todo was not included in formatlist. Exiting." + exit 1 +fi + +$OSYNCTOOL --listformats | grep -q "xmlformat-note$" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: xmlformat-note was not included in formatlist. Exiting." + exit 1 +fi + |