Skip to content

Commit

Permalink
Fix e2e tests (#10061)
Browse files Browse the repository at this point in the history
Signed-off-by: ShylajaDevadiga <shylaja.devadiga@suse.com>
Co-authored-by: ShylajaDevadiga <shylaja.devadiga@suse.com>
  • Loading branch information
ShylajaDevadiga and ShylajaDevadiga authored May 6, 2024
1 parent 6531fb7 commit 1454953
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/token/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ var _ = Describe("Use the token CLI to create and join agents", Ordered, func()
serverToken := "1234"
It("Creates a new server token", func() {
Expect(e2e.RunCmdOnNode("k3s token rotate -t vagrant --new-token="+serverToken, serverNodeNames[0])).
To(ContainSubstring("Token rotated, restart k3s with new token"))
To(ContainSubstring("Token rotated, restart k3s nodes with new token"))
})
It("Restarts servers with the new token", func() {
cmd := fmt.Sprintf("sed -i 's/token:.*/token: %s/' /etc/rancher/k3s/config.yaml", serverToken)
Expand Down
14 changes: 2 additions & 12 deletions tests/e2e/upgradecluster/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ REGISTRY = (ENV['E2E_REGISTRY'] || "")
GOCOVER = (ENV['E2E_GOCOVER'] || "")
NODE_CPUS = (ENV['E2E_NODE_CPUS'] || 2).to_i
NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 2048).to_i
GITHUB_BRANCH = (ENV['E2E_GITHUB_BRANCH'] || "master")
# Virtualbox >= 6.1.28 require `/etc/vbox/network.conf` for expanded private networks
NETWORK_PREFIX = "10.10.11"
install_type = ""
Expand All @@ -26,19 +27,8 @@ def provision(vm, role, role_num, node_num)
load vagrant_defaults

defaultOSConfigure(vm)

if RELEASE_VERSION == "skip"
install_type = "INSTALL_K3S_SKIP_DOWNLOAD=true"
elsif !RELEASE_VERSION.empty?
install_type = "INSTALL_K3S_VERSION=#{RELEASE_VERSION}"
elsif RELEASE_CHANNEL == "commit"
vm.provision "shell", path: "../scripts/latest_commit.sh", args: ["master", "/tmp/k3s_commits"]
install_type = "INSTALL_K3S_COMMIT=$(head\ -n\ 1\ /tmp/k3s_commits)"
else
install_type = "INSTALL_K3S_CHANNEL=#{RELEASE_CHANNEL}"
end


install_type = getInstallType(vm, RELEASE_VERSION, GITHUB_BRANCH, RELEASE_CHANNEL)

vm.provision "shell", inline: "ping -c 2 k3s.io"
db_type = getDBType(role, role_num, vm)
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/vagrantdefaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ def defaultOSConfigure(vm)
end
end

def getInstallType(vm, release_version, branch)
def getInstallType(vm, release_version, branch, release_channel='')
if release_version == "skip"
install_type = "INSTALL_K3S_SKIP_DOWNLOAD=true"
elsif !release_version.empty?
return "INSTALL_K3S_VERSION=#{release_version}"
elsif release_channel != "commit"
return "INSTALL_K3S_CHANNEL=#{release_channel}"
else
jqInstall(vm)
scripts_location = Dir.exists?("./scripts") ? "./scripts" : "../scripts"
Expand Down

0 comments on commit 1454953

Please sign in to comment.