summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-11-30 10:54:50 +0100
committerunknown <msvensson@neptunus.(none)>2006-11-30 10:54:50 +0100
commit708bce0a97eaf3fd8e55c004a60d1cef07bd1997 (patch)
tree5968e4c88abf753e71361b79fd37b7a06494ff73 /mysql-test
parentacce5337eca228d36ef73c9e218bf0f0ac41579d (diff)
downloadmariadb-git-708bce0a97eaf3fd8e55c004a60d1cef07bd1997.tar.gz
Add "chmod" command to mysqltest
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/mysqltest.result6
-rw-r--r--mysql-test/t/mysqltest.test40
2 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index a63863977b0..3ddb82d4a8d 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -512,6 +512,12 @@ mysqltest: At line 1: End of line junk detected: "write_file filename ";
mysqltest: At line 1: Missing required argument 'filename' to command 'file_exists'
mysqltest: At line 1: Missing required argument 'from_file' to command 'copy_file'
mysqltest: At line 1: Missing required argument 'to_file' to command 'copy_file'
+mysqltest: At line 1: Missing required argument 'mode' to command 'chmod'
+mysqltest: At line 1: You must write a 4 digit octal number for mode
+mysqltest: At line 1: You must write a 4 digit octal number for mode
+mysqltest: At line 1: Missing required argument 'file' to command 'chmod'
+mysqltest: At line 1: You must write a 4 digit octal number for mode
+mysqltest: At line 1: You must write a 4 digit octal number for mode
hello
hello
hello
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 3c20b38722f..c06d51d9d49 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -1522,6 +1522,46 @@ remove_file $MYSQLTEST_VARDIR/tmp/file2.tmp;
--exec echo "copy_file from_file;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
+# test for chmod
+# ----------------------------------------------------------------------------
+--write_file $MYSQLTEST_VARDIR/tmp/file1.tmp
+file1
+EOF
+
+chmod 0000 $MYSQLTEST_VARDIR/tmp/file1.tmp;
+# The below write fails, but --error is not implemented
+# for write_file
+#--write_file $MYSQLTEST_VARDIR/tmp/file1.tmp
+#test should fail
+#EOF
+
+chmod 0777 $MYSQLTEST_VARDIR/tmp/file1.tmp;
+--write_file $MYSQLTEST_VARDIR/tmp/file1.tmp
+test2
+EOF
+
+remove_file $MYSQLTEST_VARDIR/tmp/file1.tmp;
+
+--error 1
+--exec echo "chmod ;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "chmod 0 from_file;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "chmod 08 from_file;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "chmod from_file;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "chmod ABZD from_file;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "chmod 06789 from_file;" | $MYSQL_TEST 2>&1
+
+
+# ----------------------------------------------------------------------------
# test for perl
# ----------------------------------------------------------------------------
--perl