Imported Upstream version 1.8.0
[platform/upstream/augeas.git] / lenses / tests / test_tmpfiles.aug
index cc34856..901d6a7 100644 (file)
@@ -172,6 +172,34 @@ Tree for <complex_arg> *)
         { "argument" = "user.name=\"John Smith\" security.SMACK64=screen" }
     }
 
+  (* Variable: valid_short_args
+A short argument value example. *)
+  let valid_short_args = "h /var/log/journal - - - - C\nh /var/log/journal - - - - +C\n"
+
+  (* Variable: valid_short_args_tree
+Tree for <valid_short_args> *)
+  let valid_short_args_tree =
+    {
+        "1"
+        { "type" = "h" }
+        { "path" = "/var/log/journal" }
+        { "mode" = "-" }
+        { "uid" = "-" }
+        { "gid" = "-" }
+        { "age" = "-" }
+        { "argument" = "C" }
+    }
+    {
+        "2"
+        { "type" = "h" }
+        { "path" = "/var/log/journal" }
+        { "mode" = "-" }
+        { "uid" = "-" }
+        { "gid" = "-" }
+        { "age" = "-" }
+        { "argument" = "+C" }
+    }
+
   (* Variable: valid_age
 Example with a complex age. *)
   let valid_age = "v /var/tmp/js 4221 johnsmith - ~10d12h\n"
@@ -277,6 +305,20 @@ Tree for <valid_base> *)
         { "argument" = "foo" }
     }
 
+  (* Variable: mode3
+Mode field example with only three digits *)
+  let mode3 = "c+! /tmp/foo 755\n"
+
+  (* Variable: mode3_tree
+Tree for <mode3> *)
+  let mode3_tree =
+    {
+        "1"
+        { "type" = "c+!" }
+        { "path" = "/tmp/foo" }
+        { "mode" = "755" }
+    }
+
 (************************************************************************
  * Group:                 INVALID EXAMPLES
  *************************************************************************)
@@ -291,7 +333,7 @@ Invalid example that contain invalid age  *)
 
   (* Variable: invalid_type
 Invalid example that contain invalid type (bad letter) *)
-  let invalid_type = "q /var/tmp/js 0000 jonhsmith 60 1s foo\n"
+  let invalid_type = "e /var/tmp/js 0000 jonhsmith 60 1s foo\n"
 
   (* Variable: invalid_type_num
  Invalid example that contain invalid type (numeric) *)
@@ -327,6 +369,8 @@ Invalid example that contain invalid mode (letter) *)
 
   test Tmpfiles.lns get complex_arg = complex_arg_tree
 
+  test Tmpfiles.lns get valid_short_args = valid_short_args_tree
+
   test Tmpfiles.lns get valid_second = valid_second_tree
 
   test Tmpfiles.lns get valid_days = valid_days_tree
@@ -339,6 +383,8 @@ Invalid example that contain invalid mode (letter) *)
 
   test Tmpfiles.lns get valid_base = valid_base_tree
 
+  test Tmpfiles.lns get mode3 = mode3_tree
+
 
 (* failure cases *)