aboutsummaryrefslogtreecommitdiffstats
path: root/lib/odbc/test/odbc_connect_SUITE.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2014-08-26 16:57:51 +0200
committerIngela Anderton Andin <[email protected]>2014-08-26 16:57:51 +0200
commitfa7cd655cc60def0a529b3d4597d124113afea31 (patch)
treeaf2e6c671beddb689de278dae9f94640b796c10f /lib/odbc/test/odbc_connect_SUITE.erl
parent83113d9f1df48dc73fbff82705e8aa3fb3af6723 (diff)
downloadotp-fa7cd655cc60def0a529b3d4597d124113afea31.tar.gz
otp-fa7cd655cc60def0a529b3d4597d124113afea31.tar.bz2
otp-fa7cd655cc60def0a529b3d4597d124113afea31.zip
odbc: Condition test case to avoid permission issues in Vista
Diffstat (limited to 'lib/odbc/test/odbc_connect_SUITE.erl')
-rw-r--r--lib/odbc/test/odbc_connect_SUITE.erl37
1 files changed, 20 insertions, 17 deletions
diff --git a/lib/odbc/test/odbc_connect_SUITE.erl b/lib/odbc/test/odbc_connect_SUITE.erl
index 2a16388929..1907069726 100644
--- a/lib/odbc/test/odbc_connect_SUITE.erl
+++ b/lib/odbc/test/odbc_connect_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -47,7 +47,7 @@ all() ->
case odbc_test_lib:odbc_check() of
ok ->
[not_exist_db, commit, rollback, not_explicit_commit,
- no_c_node, port_dies, control_process_dies,
+ no_c_executable, port_dies, control_process_dies,
{group, client_dies}, connect_timeout, timeout,
many_timeouts, timeout_reset, disconnect_on_timeout,
connection_closed, disable_scrollable_cursors,
@@ -248,28 +248,31 @@ not_exist_db(_Config) ->
test_server:sleep(100).
%%-------------------------------------------------------------------------
-no_c_node(doc) ->
+no_c_executable(doc) ->
"Test what happens if the port-program can not be found";
-no_c_node(suite) -> [];
-no_c_node(_Config) ->
+no_c_executable(suite) -> [];
+no_c_executable(_Config) ->
process_flag(trap_exit, true),
Dir = filename:nativename(filename:join(code:priv_dir(odbc),
"bin")),
FileName1 = filename:nativename(os:find_executable("odbcserver",
Dir)),
FileName2 = filename:nativename(filename:join(Dir, "odbcsrv")),
- ok = file:rename(FileName1, FileName2),
- Result =
- case catch odbc:connect(?RDBMS:connection_string(),
- odbc_test_lib:platform_options()) of
- {error, port_program_executable_not_found} ->
- ok;
- Else ->
- Else
- end,
-
- ok = file:rename(FileName2, FileName1),
- ok = Result.
+ case file:rename(FileName1, FileName2) of
+ ok ->
+ Result =
+ case catch odbc:connect(?RDBMS:connection_string(),
+ odbc_test_lib:platform_options()) of
+ {error, port_program_executable_not_found} ->
+ ok;
+ Else ->
+ Else
+ end,
+ ok = file:rename(FileName2, FileName1),
+ ok = Result;
+ _ ->
+ {skip, "File permission issues"}
+ end.
%%------------------------------------------------------------------------
port_dies(doc) ->