Skip to content

Commit

Permalink
add harness.handle_exec() to unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
AmberCharitos committed Nov 12, 2024
1 parent b7870c2 commit 704a47b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,9 @@ def simulate_usersync_lifecycle(harness):
harness.charm.on.ranger_pebble_ready.emit(container)

harness.update_config({"charm-function": "usersync"})
harness.handle_exec(
"ranger", ["/bin/sh"], result="/usr/lib/jvm/java-21-openjdk-amd64/"
)

# Simulate LDAP readiness.
rel_id = harness.add_relation("ldap", "comsys-openldap-k8s")
Expand All @@ -543,6 +546,9 @@ def simulate_admin_lifecycle(harness):
container = harness.model.unit.get_container("ranger")
harness.charm.on.ranger_pebble_ready.emit(container)

harness.handle_exec(
"ranger", ["/bin/sh"], result="/usr/lib/jvm/java-21-openjdk-amd64/"
)
harness.handle_exec("ranger", ["keytool"], result=0)

# Simulate database readiness.
Expand Down

0 comments on commit 704a47b

Please sign in to comment.