gitlab.com/evatix-go/core@v1.3.55/tests/testwrappers/chmodhelpertestwrappers/VerifyRwxChmodUsingRwxInstructionsTestCases.go (about)

     1  package chmodhelpertestwrappers
     2  
     3  import "gitlab.com/evatix-go/core/chmodhelper/chmodins"
     4  
     5  var VerifyRwxChmodUsingRwxInstructionsTestCases = []VerifyRwxChmodUsingRwxInstructionsWrapper{
     6  	{
     7  		Header: "rwx - missing paths",
     8  		RwxInstruction: chmodins.RwxInstruction{
     9  			RwxOwnerGroupOther: chmodins.RwxOwnerGroupOther{
    10  				Owner: "rwx",
    11  				Group: "rwx",
    12  				Other: "---",
    13  			},
    14  			Condition: chmodins.Condition{
    15  				IsSkipOnInvalid:   false,
    16  				IsContinueOnError: false,
    17  				IsRecursive:       false,
    18  			},
    19  		},
    20  		Locations: SimpleLocations,
    21  		ExpectedErrorMessage: "Path missing or having other access issues! Reference(s) { \"[" +
    22  			"/temp/core/test-cases-3s " +
    23  			"/temp/core/test-cases-3x" +
    24  			"]\" }",
    25  	},
    26  	{
    27  		Header: "rwx - expectation failed",
    28  		RwxInstruction: chmodins.RwxInstruction{
    29  			RwxOwnerGroupOther: chmodins.RwxOwnerGroupOther{
    30  				Owner: "rwx",
    31  				Group: "r-x",
    32  				Other: "---",
    33  			},
    34  			Condition: chmodins.Condition{
    35  				IsSkipOnInvalid:   true,
    36  				IsContinueOnError: true,
    37  				IsRecursive:       false,
    38  			},
    39  		},
    40  		Locations: SimpleLocations,
    41  		ExpectedErrorMessage: "Path:/temp/core/test-cases-2 - " +
    42  			"Expect [\"rwxr-x---\"] != [\"rwxr-xr--\"] Actual\n" +
    43  			"Path:/temp/core/test-cases-3 - " +
    44  			"Expect [\"rwxr-x---\"] != [\"rwxr-xr--\"] Actual",
    45  	},
    46  	{
    47  		Header: "Recursive not supported",
    48  		RwxInstruction: chmodins.RwxInstruction{
    49  			RwxOwnerGroupOther: chmodins.RwxOwnerGroupOther{
    50  				Owner: "rwx",
    51  				Group: "r-x",
    52  				Other: "---",
    53  			},
    54  			Condition: chmodins.Condition{
    55  				IsSkipOnInvalid:   true,
    56  				IsContinueOnError: true,
    57  				IsRecursive:       true,
    58  			},
    59  		},
    60  		Locations: SimpleLocations,
    61  		ExpectedErrorMessage: "Not Supported: Feature / method is not supported yet. " +
    62  			"IsRecursive is not supported for Verify chmod. " +
    63  			"Reference(s) { \"[" +
    64  			"/temp/core/test-cases-2 " +
    65  			"/temp/core/test-cases-3s " +
    66  			"/temp/core/test-cases-3x " +
    67  			"/temp/core/test-cases-3" +
    68  			"]\" }",
    69  	},
    70  	{
    71  		Header: "Missing paths + Expection failed",
    72  		RwxInstruction: chmodins.RwxInstruction{
    73  			RwxOwnerGroupOther: chmodins.RwxOwnerGroupOther{
    74  				Owner: "rwx",
    75  				Group: "r-x",
    76  				Other: "---",
    77  			},
    78  			Condition: chmodins.Condition{
    79  				IsSkipOnInvalid:   false,
    80  				IsContinueOnError: true,
    81  				IsRecursive:       false,
    82  			},
    83  		},
    84  		Locations: SimpleLocations,
    85  		ExpectedErrorMessage: "Path missing or having other access issues! Reference(s) { " +
    86  			"\"" +
    87  			"[" +
    88  			"/temp/core/test-cases-3s " +
    89  			"/temp/core/test-cases-3x" +
    90  			"]" +
    91  			"\" }\n" +
    92  			"Path:" +
    93  			"/temp/core/test-cases-3 - " +
    94  			"Expect [\"rwxr-x---\"] != [\"rwxr-xr--\"] Actual\n" +
    95  			"Path:/temp/core/test-cases-2 - " +
    96  			"Expect [\"rwxr-x---\"] != [\"rwxr-xr--\"] Actual",
    97  	},
    98  	{
    99  		Header: "Expectation and missing paths, isContinue false so will fail for missing paths only",
   100  		RwxInstruction: chmodins.RwxInstruction{
   101  			RwxOwnerGroupOther: chmodins.RwxOwnerGroupOther{
   102  				Owner: "rwx",
   103  				Group: "r-x",
   104  				Other: "---",
   105  			},
   106  			Condition: chmodins.Condition{
   107  				IsSkipOnInvalid:   false,
   108  				IsContinueOnError: false,
   109  				IsRecursive:       false,
   110  			},
   111  		},
   112  		Locations: SimpleLocations,
   113  		ExpectedErrorMessage: "Path missing or having other access issues! Reference(s) { " +
   114  			"\"" +
   115  			"[" +
   116  			"/temp/core/test-cases-3s " +
   117  			"/temp/core/test-cases-3x" +
   118  			"]" +
   119  			"\" }",
   120  	},
   121  }