You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -61,6 +62,7 @@ However, to build the `index management` plugin project, we also use the OpenSea
61
62
10.`./gradlew indexmanagementBwcCluster#fullRestartClusterTask -Dtests.security.manager=false` launches a cluster with three nodes of bwc version of OpenSearch with index management and tests backwards compatibility by performing a full restart on the cluster upgrading all the nodes with the current version of OpenSearch with index management.
62
63
11.`./gradlew bwcTestSuite -Dtests.security.manager=false` runs all the above bwc tests combined.
63
64
12.`./gradlew integTestRemote -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster" -Dhttps=true -Duser=admin -Dpassword=admin` launches integration tests against a local cluster and run tests with security
65
+
13.`./gradlew integTest -Dsecurity=true -Dhttps=true --tests '*SecurityBehaviorIT'` runs all security behavior tests with security enabled
64
66
65
67
When launching a cluster using one of the above commands, logs are placed in `build/testclusters/integTest-0/logs`. Though the logs are teed to the console, in practices it's best to check the actual log file.
66
68
@@ -89,6 +91,66 @@ After running with coverage enabled, reports are generated in:
-**XML Report**: `build/reports/jacoco/test/jacocoTestReport.xml` (for tools like Codecov)
91
93
94
+
### Security Behavior Tests
95
+
96
+
Security behavior tests ensure that the Index Management plugin properly enforces access controls and permissions. These tests validate that users can only perform operations they are authorized for and receive appropriate error responses when access is denied.
97
+
98
+
#### Overview
99
+
100
+
Security behavior tests extend the `SecurityRestTestCase` base class and test various permission scenarios:
101
+
- API endpoint permission enforcement
102
+
- Policy based authentication and authorization
103
+
104
+
#### Running Security Tests
105
+
106
+
Security tests require additional flags and must be run against a cluster with security enabled:
// Test that authorized users can perform operations
146
+
}
147
+
148
+
funtestUnauthorizedAccess() {
149
+
// Test that unauthorized users receive proper error responses
150
+
}
151
+
}
152
+
```
153
+
92
154
### Debugging
93
155
94
156
Sometimes it is useful to attach a debugger to either the OpenSearch cluster or the integ tests to see what's going on. When running unit tests, hit **Debug** from the IDE's gutter to debug the tests. For the OpenSearch cluster or the integ tests, first, make sure start a debugger listening on port `5005`.
0 commit comments