Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,019 changes: 1,019 additions & 0 deletions harvester_robot_tests/keywords/rancher.resource

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion harvester_robot_tests/keywords/variables.resource
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ${DEFAULT_VM_MEMORY} 4Gi
${DEFAULT_VM_REPLICAS} 3

# Storage
${DEFAULT_STORAGE_CLASS} longhorn
${DEFAULT_STORAGE_CLASS} harvester-longhorn
${DEFAULT_VOLUME_SIZE} 10Gi

# Test Execution
Expand All @@ -45,4 +45,19 @@ ${NVIDIA_TOOLKIT_IMAGE_REPO} %{NVIDIA_TOOLKIT_IMAGE_REPO=nvidia/driver-toolki
${NVIDIA_TOOLKIT_IMAGE_TAG} %{NVIDIA_TOOLKIT_IMAGE_TAG=v1.7-20260209}
${NVIDIA_TOOLKIT_DRIVER_LOCATION} %{NVIDIA_TOOLKIT_DRIVER_LOCATION=http://HTTPENDPOINT/NVIDIA-Linux-x86_64-VERSION-vgpu-kvm.run}

# Rancher Integration
${RANCHER_ENDPOINT} %{RANCHER_ENDPOINT=https://rancher.localhost}
${RANCHER_USERNAME} %{RANCHER_USERNAME=admin}
${RANCHER_PASSWORD} %{RANCHER_PASSWORD=password}
${RANCHER_WAIT_TIMEOUT} 1800

# RKE2 Version Configuration
${RKE2_VERSION} %{RKE2_VERSION=v1.34}

# Ingress Controller: traefik (default, recommended by Rancher) or nginx
${INGRESS_CONTROLLER} %{INGRESS_CONTROLLER=traefik}

# IP Pool for LoadBalancer tests
${IP_POOL_SUBNET} %{IP_POOL_SUBNET=192.168.1.0/24}
${IP_POOL_START} %{IP_POOL_START=192.168.1.100}
${IP_POOL_END} %{IP_POOL_END=192.168.1.200}
40 changes: 39 additions & 1 deletion harvester_robot_tests/libs/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class HarvesterOperationStrategy(Enum):
RUN_STRATEGY_RERUN_ON_FAILURE = "RerunOnFailure"

# Storage Class
DEFAULT_STORAGE_CLASS = "longhorn"
DEFAULT_STORAGE_CLASS = "harvester-longhorn"

# Retry and Timeout Defaults
DEFAULT_RETRY_COUNT = 100
Expand All @@ -116,3 +116,41 @@ class HarvesterOperationStrategy(Enum):
PCIDEVICES_NAMESPACE = "harvester-system"
PCIDEVICES_CONTROLLER_LABEL = "app.kubernetes.io/name=harvester-pcidevices-controller"
PCIDEVICES_WEBHOOK_SERVICE = "pcidevices-webhook"

# Rancher Integration Constants
RANCHER_WAIT_TIMEOUT = 1800 # 30 minutes for cluster operations
RANCHER_NAMESPACE = "fleet-default"

# Cloud-init user data for RKE2 nodes
DEFAULT_RKE2_USER_DATA = """#cloud-config
password: password
chpasswd:
expire: false
ssh_pwauth: true
package_update: true
Comment on lines +125 to +130
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEFAULT_RKE2_USER_DATA hard-codes a plaintext password and enables SSH password auth by default. Even for test suites, this is a risky default that can leak into shared environments. Consider sourcing credentials from environment/Robot variables (or defaulting to SSH key-only) and documenting the expected security posture.

Copilot uses AI. Check for mistakes.
packages:
- qemu-guest-agent
runcmd:
- - systemctl
- enable
- '--now'
- qemu-guest-agent.service
"""

# RKE2 Kubernetes versions (defaults)
DEFAULT_RKE2_VERSION = "v1.33"

# Rancher API groups and versions
RANCHER_MGMT_GROUP = "management.cattle.io"
RANCHER_MGMT_VERSION = "v3"
RANCHER_PROVISIONING_GROUP = "provisioning.cattle.io"
RANCHER_PROVISIONING_VERSION = "v1"

# Harvester cloud provider deployments
HARVESTER_CLOUD_PROVIDER_DEPLOYMENT = "harvester-cloud-provider"
HARVESTER_CSI_DRIVER_DEPLOYMENT = "harvester-csi-driver-controllers"

# Default VM config for RKE2 nodes
DEFAULT_RKE2_NODE_CPUS = 4
DEFAULT_RKE2_NODE_MEMORY = 8 # GB
DEFAULT_RKE2_NODE_DISK = 80 # GB
Loading
Loading