This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 7604401b06d [Enhance](regression)Do path creation ahead of time for 
case test_export_external_table (#28616)
7604401b06d is described below

commit 7604401b06d90df988a4c9c623cb606fc595dc00
Author: zhangguoqiang <18372634...@163.com>
AuthorDate: Fri Dec 29 17:59:20 2023 +0800

    [Enhance](regression)Do path creation ahead of time for case 
test_export_external_table (#28616)
    
    Do path creation ahead of time for case test_export_external_table
---
 .../main/groovy/org/apache/doris/regression/suite/Suite.groovy |  8 ++++++++
 .../external_table_p0/export/test_export_external_table.groovy | 10 ++++++++++
 2 files changed, 18 insertions(+)

diff --git 
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
 
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
index a299f0a01d4..942f44f8d8d 100644
--- 
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
+++ 
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
@@ -575,6 +575,14 @@ class Suite implements GroovyInterceptable {
         Assert.assertEquals(0, code)
     }
 
+    void mkdirRemote(String username, String host, String path) {
+        String cmd = "ssh ${username}@${host} 'mkdir -p ${path}'"
+        logger.info("Execute: ${cmd}".toString())
+        Process process = cmd.execute()
+        def code = process.waitFor()
+        Assert.assertEquals(0, code)
+    }
+
     void sshExec(String username, String host, String cmd) {
         String command = "ssh ${username}@${host} '${cmd}'"
         def cmds = ["/bin/bash", "-c", command]
diff --git 
a/regression-test/suites/external_table_p0/export/test_export_external_table.groovy
 
b/regression-test/suites/external_table_p0/export/test_export_external_table.groovy
index 48cfb9e83e8..69b29b14e24 100644
--- 
a/regression-test/suites/external_table_p0/export/test_export_external_table.groovy
+++ 
b/regression-test/suites/external_table_p0/export/test_export_external_table.groovy
@@ -55,12 +55,22 @@ suite("test_export_external_table", 
"p0,external,mysql,external_docker,external_
     }
 
     def check_path_exists = { dir_path ->
+        List<List<Object>> backends =  sql """ show backends """
+        assertTrue(backends.size() > 0)
         File path = new File(dir_path)
         if (!path.exists()) {
             assert path.mkdirs()
         } else {
             throw new IllegalStateException("""${dir_path} already exists! """)
         }
+        if (backends.size() > 1) {
+            for (List<Object> backend : backends) {
+                def be_host = backend[1]
+                def cmd="""mkdir -p ${dir_path}"""
+                sshExec("root", be_host, cmd.toString())
+            }
+        }
+
     }
     def check_file_amounts = { dir_path, amount ->
         File path = new File(dir_path)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to