mirror of https://github.com/k3s-io/k3s
Fix e2e tests (#10061)
Signed-off-by: ShylajaDevadiga <shylaja.devadiga@suse.com> Co-authored-by: ShylajaDevadiga <shylaja.devadiga@suse.com>pull/10873/head
parent
9d86578a59
commit
1ae49401e8
|
@ -156,7 +156,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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -14,11 +14,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.exist?("./scripts") ? "./scripts" : "../scripts"
|
||||
|
|
Loading…
Reference in New Issue