-
Notifications
You must be signed in to change notification settings - Fork 899
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9085 from rundeck/exp/blocklist-test-replacement
RUN-2317: convert plugin blocklist test
- Loading branch information
Showing
20 changed files
with
89 additions
and
910 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...tional-test/src/test/groovy/org/rundeck/tests/functional/integration/BlocklistSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.rundeck.tests.functional.integration | ||
|
||
import org.rundeck.util.annotations.BlocklistTest | ||
import org.rundeck.util.container.BaseContainer | ||
|
||
@BlocklistTest | ||
class BlocklistSpec extends BaseContainer { | ||
|
||
|
||
public static final int EXPECTED_PLUGIN_LIST_SIZE = 64 | ||
static List<String> BLOCKED_NAMES = [ | ||
'cyberark', | ||
'openssh', | ||
'ansible', | ||
'copyfile', | ||
'localexec', | ||
'rundeck-script' | ||
] | ||
|
||
def "test blocklist does not contain blocked plugins"() { | ||
when: | ||
List<Map> response = get("/plugin/list", List) | ||
def artifactNames = response*.artifactName.collect { it.toString().toLowerCase() } | ||
then: | ||
verifyAll { | ||
for (String name : BLOCKED_NAMES) { | ||
artifactNames.find { it.contains(name) } == null | ||
} | ||
} | ||
} | ||
|
||
def "test expected plugin count"() { | ||
when: | ||
List<Map> response = get("/plugin/list", List) | ||
then: | ||
response.size() == EXPECTED_PLUGIN_LIST_SIZE | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
functional-test/src/test/groovy/org/rundeck/util/annotations/BlocklistTest.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.rundeck.util.annotations | ||
|
||
import java.lang.annotation.ElementType | ||
import java.lang.annotation.Retention | ||
import java.lang.annotation.RetentionPolicy | ||
import java.lang.annotation.Target | ||
|
||
@Target([ElementType.TYPE, ElementType.METHOD]) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@interface BlocklistTest { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,4 @@ providerNameEntries: | |
- script | ||
- local | ||
WorkflowStep: | ||
- github-script-step | ||
- github-script-step |
17 changes: 17 additions & 0 deletions
17
functional-test/src/test/resources/docker/compose/oss/docker-compose-blocklist.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: "3" | ||
services: | ||
rundeck: | ||
image: ${TEST_IMAGE} | ||
environment: | ||
RUNDECK_GRAILS_URL: ${TEST_RUNDECK_GRAILS_URL} | ||
RUNDECK_SERVER_FORWARDED: 'true' | ||
RUNDECK_TOKENS_FILE: /home/rundeck/server/config/tokens.properties | ||
RUNDECK_MULTIURL_ENABLED: "true" | ||
RUNDECK_METRICS_ENABLED: "true" | ||
RUNDECK_PLUGINS_PROVIDERBLOCKLISTFILE: /home/rundeck/blocklist.yaml | ||
volumes: | ||
- "/etc/localtime:/etc/localtime:ro" | ||
- "/etc/timezone:/etc/timezone:ro" | ||
- "../../../tokens.properties:/home/rundeck/server/config/tokens.properties" | ||
- "../../../realm.properties:/home/rundeck/server/config/realm.properties" | ||
- "../../../blocklist-test/blocklist.yaml:/home/rundeck/blocklist.yaml" |
5 changes: 5 additions & 0 deletions
5
functional-test/src/test/resources/spock-configs/IncludeBlocklistTestsConfig.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import org.rundeck.util.annotations.BlocklistTest | ||
|
||
runner { | ||
include BlocklistTest | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.