aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/torture.c10
-rw-r--r--tests/torture.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/torture.c b/tests/torture.c
index 7456cb60..983f1c38 100644
--- a/tests/torture.c
+++ b/tests/torture.c
@@ -128,6 +128,16 @@ int torture_rmdirs(const char *path) {
return 0;
}
+int torture_isdir(const char *path) {
+ struct stat sb;
+
+ if (lstat (path, &sb) == 0 && S_ISDIR(sb.st_mode)) {
+ return 1;
+ }
+
+ return 0;
+}
+
int torture_libssh_verbosity(void){
return verbosity;
}
diff --git a/tests/torture.h b/tests/torture.h
index cc8abbc8..e80d0e76 100644
--- a/tests/torture.h
+++ b/tests/torture.h
@@ -47,6 +47,7 @@ struct argument_s {
void torture_cmdline_parse(int argc, char **argv, struct argument_s *arguments);
int torture_rmdirs(const char *path);
+int torture_isdir(const char *path);
/*
* Returns the verbosity level asked by user