yanglint TEST disabled_searchdir for non-int mode
diff --git a/tools/lint/tests/common.tcl b/tools/lint/tests/common.tcl
index e432bf9..ed60463 100644
--- a/tools/lint/tests/common.tcl
+++ b/tools/lint/tests/common.tcl
@@ -6,6 +6,9 @@
     set ::env(TESTS_DIR) "../"
     set ::env(YANG_MODULES_DIR) "../modules"
     set ::env(YANGLINT) "../../../../build/yanglint"
+    ::tcltest::testConstraint ctest false
+} else {
+    ::tcltest::testConstraint ctest true
 }
 
 # prompt of error message
diff --git a/tools/lint/tests/modules/modimp-cwd.yang b/tools/lint/tests/modules/modimp-cwd.yang
new file mode 100644
index 0000000..3249462
--- /dev/null
+++ b/tools/lint/tests/modules/modimp-cwd.yang
@@ -0,0 +1,8 @@
+module modimp-cwd {
+  namespace "urn:yanglint:modimp-cwd";
+  prefix ic;
+
+  import modcwd {
+    prefix mc;
+  }
+}
diff --git a/tools/lint/tests/non-interactive/disabled_searchdir.test b/tools/lint/tests/non-interactive/disabled_searchdir.test
new file mode 100644
index 0000000..49fe13e
--- /dev/null
+++ b/tools/lint/tests/non-interactive/disabled_searchdir.test
@@ -0,0 +1,18 @@
+source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/non-interactive/ly.tcl" : "ly.tcl"}]
+
+set mdir $env(YANG_MODULES_DIR)
+
+# Test should be skipped if called by ctest.
+test disable_searchdir_once {Unsuccessfully imports module due to disabled cwd searching} {
+-constraints {!ctest} -body {
+    ly_cmd "$mdir/modimp-cwd.yang"
+    ly_cmd_err "-D $mdir/modimp-cwd.yang" "not found in local searchdirs"
+}}
+
+test disable_searchdir_twice {Unsuccessfully imports module due to -D -D} {
+    ly_cmd "$mdir/ietf-ip.yang"
+    ly_cmd_err "-D -D $mdir/ietf-ip.yang" "Loading \"ietf-interfaces\" module failed."
+} {}
+
+cleanupTests
+
diff --git a/tools/lint/tests/non-interactive/modcwd.yang b/tools/lint/tests/non-interactive/modcwd.yang
new file mode 100644
index 0000000..db33e73
--- /dev/null
+++ b/tools/lint/tests/non-interactive/modcwd.yang
@@ -0,0 +1,4 @@
+module modcwd {
+  namespace "urn:yanglint:modcwd";
+  prefix mc;
+}