diff --git a/tests/e2e/token/token_test.go b/tests/e2e/token/token_test.go index af07814dcb..2790714b6f 100644 --- a/tests/e2e/token/token_test.go +++ b/tests/e2e/token/token_test.go @@ -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) diff --git a/tests/e2e/upgradecluster/Vagrantfile b/tests/e2e/upgradecluster/Vagrantfile index b5e76c79e3..704133a4dc 100644 --- a/tests/e2e/upgradecluster/Vagrantfile +++ b/tests/e2e/upgradecluster/Vagrantfile @@ -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 = "" @@ -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) diff --git a/tests/e2e/vagrantdefaults.rb b/tests/e2e/vagrantdefaults.rb index b962a0744d..0f07b99e6c 100644 --- a/tests/e2e/vagrantdefaults.rb +++ b/tests/e2e/vagrantdefaults.rb @@ -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"