-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Chin-Ya Huang <[email protected]>
- Loading branch information
Showing
8 changed files
with
66 additions
and
105 deletions.
There are no files selected for viewing
21 changes: 11 additions & 10 deletions
21
e2e/libs/keywords/node_instance_keywords.py → e2e/libs/keywords/host_keywords.py
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 |
---|---|---|
@@ -1,51 +1,52 @@ | ||
from robot.libraries.BuiltIn import BuiltIn | ||
|
||
from host import Host | ||
from host.constant import NODE_REBOOT_DOWN_TIME_SECOND | ||
|
||
from node import Node | ||
from node import NodeInstance | ||
from node.constant import NODE_REBOOT_DOWN_TIME_SECOND | ||
|
||
from utility.utility import logging | ||
|
||
|
||
class node_instance_keywords: | ||
class host_keywords: | ||
|
||
def __init__(self): | ||
self.volume_keywords = BuiltIn().get_library_instance('volume_keywords') | ||
|
||
self.host = Host() | ||
self.node = Node() | ||
self.nodeInstance = NodeInstance() | ||
|
||
def reboot_volume_node(self, volume_name): | ||
node_id = self.volume_keywords.get_node_id_by_replica_locality(volume_name, "volume node") | ||
|
||
logging(f'Rebooting volume {volume_name} node {node_id} with downtime {NODE_REBOOT_DOWN_TIME_SECOND} seconds') | ||
self.nodeInstance.reboot_node(node_id) | ||
self.host.reboot_node(node_id) | ||
|
||
def reboot_replica_node(self, volume_name): | ||
node_id = self.volume_keywords.get_node_id_by_replica_locality(volume_name, "replica node") | ||
|
||
logging(f'Rebooting volume {volume_name} node {node_id} with downtime {NODE_REBOOT_DOWN_TIME_SECOND} seconds') | ||
self.nodeInstance.reboot_node(node_id) | ||
self.host.reboot_node(node_id) | ||
|
||
def reboot_node_by_index(self, idx, power_off_time_in_min=1): | ||
node_name = self.node.get_node_by_index(idx) | ||
reboot_down_time_min = int(power_off_time_in_min) * 60 | ||
|
||
logging(f'Rebooting node {node_name} with downtime {reboot_down_time_min} minutes') | ||
self.nodeInstance.reboot_node(node_name, reboot_down_time_min) | ||
self.host.reboot_node(node_name, reboot_down_time_min) | ||
|
||
def reboot_all_worker_nodes(self, power_off_time_in_min=1): | ||
reboot_down_time_min = int(power_off_time_in_min) * 60 | ||
|
||
logging(f'Rebooting all worker nodes with downtime {reboot_down_time_min} minutes') | ||
self.nodeInstance.reboot_all_worker_nodes(reboot_down_time_min) | ||
self.host.reboot_all_worker_nodes(reboot_down_time_min) | ||
|
||
def reboot_all_nodes(self): | ||
logging(f'Rebooting all nodes with downtime {NODE_REBOOT_DOWN_TIME_SECOND} seconds') | ||
self.nodeInstance.reboot_all_nodes() | ||
self.host.reboot_all_nodes() | ||
|
||
def reboot_node_by_name(self, node_name, downtime_in_min=1): | ||
reboot_down_time_min = int(downtime_in_min) * 60 | ||
|
||
logging(f'Rebooting node {node_name} with downtime {reboot_down_time_min} minutes') | ||
self.nodeInstance.reboot_node(node_name, reboot_down_time_min) | ||
self.host.reboot_node(node_name, reboot_down_time_min) |
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
from node.node import Node | ||
from node.node_instance import NodeInstance | ||
from node.stress import Stress |
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 was deleted.
Oops, something went wrong.
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