Skip to content

Commit

Permalink
Add OWASP dependency check test (#103)
Browse files Browse the repository at this point in the history
* add owasp dependency check test

* add owasp dependency check test
  • Loading branch information
gtrkiller committed Jan 29, 2024
1 parent 1c2fec0 commit e771448
Show file tree
Hide file tree
Showing 2 changed files with 23 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,docker-build-publish,ldap,matrix-combinations-parameter,postbuildscript,ssh-agent,blueocean,thinBackup,rebuild,openid,oic-auth,pipeline-groovy-lib,kubernetes"
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"
22 changes: 22 additions & 0 deletions tests/integration/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,28 @@ async def test_docker_build_publish_plugin(unit_web_client: UnitWebClient):
), f"docker-build-publish 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.
act: when a job configuration page is accessed.
assert: dependency-check-jenkins-plugin plugin option exists.
"""
await install_plugins(unit_web_client, ("dependency-check-jenkins-plugin",))
unit_web_client.client.create_job("deps_plugin_test", gen_test_job_xml("k8s"))
res = unit_web_client.client.requester.get_url(
f"{unit_web_client.web}/job/deps_plugin_test/configure"
)
job_page = str(res.content, "utf-8")
assert (
"Invoke Dependency-Check" in job_page
), f"Dependency check job configuration option not found. {job_page}"
res = unit_web_client.client.requester.get_url(f"{unit_web_client.web}/manage/configureTools/")
tools_page = str(res.content, "utf-8")
assert (
"Dependency-Check installations" in tools_page
), f"Dependency check tool configuration option not found. {tools_page}"


async def test_groovy_libs_plugin(unit_web_client: UnitWebClient):
"""
arrange: given a Jenkins charm with pipeline-groovy-lib plugin installed.
Expand Down

0 comments on commit e771448

Please sign in to comment.