Skip to content

Commit 8945dc8

Browse files
Merge pull request #286 from aleksei-burlakov/update-test-add-primitive
Update: test_add_primitive
2 parents a23057e + 42b1789 commit 8945dc8

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

e2e_test/hawk_test_driver.py

+5-10
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Error:
3131

3232
# XPATH constants
3333
class Xpath:
34-
ANYTHING_OPT_LIST = '//option[contains(@value, "anything")]'
34+
DUMMY_OPT_LIST = '//option[contains(@value, "Dummy")]'
3535
CLICK_OK_SUBMIT = '//*[@id="modal"]/div/div/form/div[3]/input'
3636
CLONE_CHILD = '//select[contains(@data-help-filter, ".row.resource") and contains(@name, "clone[child]")]'
3737
CLONE_DATA_HELP_FILTER = '//a[contains(@data-help-filter, ".clone")]'
@@ -602,13 +602,8 @@ def test_add_primitive(self, primitive):
602602
print(f"ERROR: Couldn't find element [primitive[type]]. Cannot add primitive [{primitive}].")
603603
return False
604604
elem.click()
605-
self.check_and_click_by_xpath("Couldn't find value [anything] for primitive type",
606-
[Xpath.ANYTHING_OPT_LIST])
607-
elem = self.find_element(By.NAME, 'primitive[params][binfile]')
608-
if not elem:
609-
print("ERROR: Couldn't find element [primitive[params][binfile]]")
610-
return False
611-
elem.send_keys("file")
605+
self.check_and_click_by_xpath("Couldn't find value [Dummy] for primitive type",
606+
[Xpath.DUMMY_OPT_LIST])
612607
# Set start timeout value in 35s
613608
self.check_and_click_by_xpath("Couldn't find edit button for start operation",
614609
[Xpath.EDIT_START_TIMEOUT, Xpath.MODAL_TIMEOUT])
@@ -642,7 +637,7 @@ def test_add_primitive(self, primitive):
642637
elem.click()
643638
status = self.verify_success()
644639
if status:
645-
print(f"INFO: Successfully added primitive [{primitive}] of class [ocf:heartbeat:anything]")
640+
print(f"INFO: Successfully added primitive [{primitive}] of class [ocf:heartbeat:Dummy]")
646641
else:
647642
print(f"ERROR: Could not create primitive [{primitive}]")
648643
return status
@@ -662,7 +657,7 @@ def remove_rsc(self, name):
662657
self.check_and_click_by_xpath(f"Cannot delete resource [{name}]", [Xpath.HREF_DELETE_FORMAT.format(name)])
663658
time.sleep(2)
664659
self.check_and_click_by_xpath(f"Cannot confirm delete of resource [{name}]", [Xpath.COMMIT_BTN_DANGER])
665-
time.sleep(2)
660+
time.sleep(20)
666661
self.check_and_click_by_xpath("Couldn't find Edit Configuration element", [Xpath.HREF_CONFIG_EDIT])
667662
time.sleep(3)
668663
if not self.test_status:

e2e_test/hawk_test_ssh.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def verify_primitive(self, primitive, version, results):
128128
False when configuration is not defined in configuration
129129
'''
130130
print(f"TEST: verify_primitive: check primitive [{primitive}] exists")
131-
matches = [f"{primitive} anything", "binfile=file", "op start timeout=35s",
131+
matches = [f"{primitive} Dummy", "op start timeout=35s",
132132
"op monitor timeout=9s interval=13s", "meta target-role=Started"]
133133
if Version(version) < Version('15'):
134134
matches.append("op stop timeout=15s")
@@ -154,7 +154,7 @@ def verify_primitive_removed(self, primitive, results):
154154
False when configuration is not removed
155155
'''
156156
print(f"TEST: verify_primitive_removed: check primitive [{primitive}] is removed")
157-
if self.check_cluster_conf_ssh("crm resource status | grep ocf::heartbeat:anything", ''):
157+
if self.check_cluster_conf_ssh("crm resource status | grep ocf::heartbeat:Dummy", ''):
158158
print("INFO: primitive successfully removed")
159159
self.set_test_status(results, 'verify_primitive_removed', 'passed')
160160
return True

hawk/app/controllers/agents_controller.rb

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def show
2222
else
2323
@name = params[:id]
2424
end
25+
@name = CGI.unescape(@name)
2526
@agent = Util.get_metadata_hash(@name)
2627

2728
if @agent

0 commit comments

Comments
 (0)