Skip to content

Commit

Permalink
Add reverse proxy plugin integration test (#105)
Browse files Browse the repository at this point in the history
* add reverse proxy test

* address comments

* address comments

* address comments

* rollback version change
  • Loading branch information
gtrkiller committed Jan 31, 2024
1 parent 7faeea6 commit c902be0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ options:
Comma-separated list of allowed plugin short names. If empty, any plugin can be installed.
Plugins installed by the user and their dependencies will be removed automatically if not on
the list. Included plugins are not automatically installed.
default: "bazaar,blueocean,dependency-check-jenkins-plugin,docker-build-publish,git,kubernetes,ldap,matrix-combinations-parameter,oic-auth,openid,pipeline-groovy-lib,postbuildscript,rebuild,ssh-agent,thinBackup"
default: "bazaar,blueocean,dependency-check-jenkins-plugin,docker-build-publish,git,kubernetes,ldap,matrix-combinations-parameter,oic-auth,openid,pipeline-groovy-lib,postbuildscript,rebuild,reverse-proxy-auth-plugin,ssh-agent,thinBackup"
18 changes: 18 additions & 0 deletions tests/integration/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,24 @@ async def test_docker_build_publish_plugin(unit_web_client: UnitWebClient):
), f"docker-build-publish configuration option not found. {config_page}"


async def test_reverse_proxy_plugin(unit_web_client: UnitWebClient):
"""
arrange: given a Jenkins charm with reverse-proxy-auth-plugin plugin installed.
act: when the security configuration is accessed.
assert: reverse-proxy-auth-plugin plugin option exists.
"""
await install_plugins(unit_web_client, ("reverse-proxy-auth-plugin",))

res = unit_web_client.client.requester.get_url(
f"{unit_web_client.web}/manage/configureSecurity"
)
config_page = str(res.content, "utf-8")

assert (
"HTTP Header by reverse proxy" in config_page
), f"reverse-proxy-auth-plugin configuration option not found. {config_page}"


async def test_dependency_check_plugin(unit_web_client: UnitWebClient):
"""
arrange: given a Jenkins charm with dependency-check-jenkins-plugin plugin installed.
Expand Down

0 comments on commit c902be0

Please sign in to comment.