This repository has been archived by the owner on Aug 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update kfctl test to v0.7.1 -> v1.0.0 (#207)
* Update kfctl test to v0.7.1 -> v1.0.0 * run upgrade test * add random string to kfam profile * fix test * fix typo
- Loading branch information
1 parent
c42f9f3
commit 521fcfe
Showing
3 changed files
with
9 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
import json | ||
from retrying import retry | ||
from time import sleep | ||
import uuid | ||
|
||
|
||
logging.basicConfig(level=logging.INFO, | ||
|
@@ -27,21 +28,22 @@ def test_kfam(record_xml_attribute): | |
|
||
sleep(10) | ||
# Profile Creation | ||
profile_name = "testprofile-%s" % uuid.uuid4().hex[0:7] | ||
util.run(['kubectl', 'exec', jupyterpod, '-n', 'kubeflow', '--', 'curl', | ||
'--silent', '-X', 'POST', '-d', | ||
'{"metadata":{"name":"testprofile"},"spec":{"owner":{"kind":"User","name":"[email protected]"}}}', | ||
'{"metadata":{"name":"%s"},"spec":{"owner":{"kind":"User","name":"[email protected]"}}}' % profile_name, | ||
'profiles-kfam.kubeflow:8081/kfam/v1/profiles']) | ||
|
||
assert verify_profile_creation(jupyterpod) | ||
assert verify_profile_creation(jupyterpod, profile_name) | ||
|
||
@retry(wait_fixed=2000, stop_max_delay=20 * 1000) | ||
def verify_profile_creation(jupyterpod): | ||
def verify_profile_creation(jupyterpod, profile_name): | ||
# Verify Profile Creation | ||
bindingsstr = util.run(['kubectl', 'exec', jupyterpod, '-n', 'kubeflow', '--', 'curl', '--silent', | ||
'profiles-kfam.kubeflow:8081/kfam/v1/bindings']) | ||
bindings = json.loads(bindingsstr) | ||
|
||
if "testprofile" not in [binding['referredNamespace'] for binding in bindings['bindings']]: | ||
if profile_name not in [binding['referredNamespace'] for binding in bindings['bindings']]: | ||
raise Exception("testprofile not created yet!") | ||
return True | ||
|
||
|