Skip to content

Commit

Permalink
update token propagate test for new token generation flow
Browse files Browse the repository at this point in the history
  • Loading branch information
jlewitt1 committed Sep 12, 2024
1 parent de2ce3b commit 157d778
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/test_resources/test_clusters/test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,20 +425,20 @@ def test_caller_token_propagated(self, cluster):
remote_assume_caller_and_get_token.share(
users=["info@run.house"], notify_users=False
)
current_username = rh.configs.username
current_den_token = rh.configs.token

with friend_account():
unassumed_token, assumed_token = remote_assume_caller_and_get_token()
# "Local token" is the token the cluster accesses in rh.configs.token; this is what will be used
# in subsequent rns_client calls
assert assumed_token == rh.globals.rns_client.cluster_token(
cluster.rns_address,
username=current_username,
den_token=current_den_token,
)
assert unassumed_token != rh.configs.token

# Both tokens should be valid for the cluster
assert rh.globals.rns_client.validate_cluster_token(
assumed_token, cluster.rns_address
)
assert rh.globals.rns_client.validate_cluster_token(
unassumed_token, cluster.rns_address
)

# Docker clusters are logged out, ondemand clusters are logged in
output = cluster.run("sed -n 's/.*token: *//p' ~/.rh/config.yaml")
# No config file
Expand Down

0 comments on commit 157d778

Please sign in to comment.