Skip to content

Commit

Permalink
E2E: Consoldiate docker and prefer bundled tests into new startup test (
Browse files Browse the repository at this point in the history
#6851)

* Convert docker E2E to startup E2E
* Move preferedbundled into the e2e startup test

Signed-off-by: Derek Nola <[email protected]>
  • Loading branch information
dereknola authored Feb 6, 2023
1 parent 3208671 commit 7cad3db
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 277 deletions.
76 changes: 0 additions & 76 deletions tests/e2e/docker/Vagrantfile

This file was deleted.

93 changes: 0 additions & 93 deletions tests/e2e/docker/docker_test.go

This file was deleted.

93 changes: 0 additions & 93 deletions tests/e2e/preferbundled/preferbundled_test.go

This file was deleted.

7 changes: 2 additions & 5 deletions tests/e2e/scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,12 @@ echo 'RUN CLUSTER RESET TEST'
echo 'RUNNING SPLIT SERVER VALIDATION TEST'
E2E_HARDENED="$hardened" /usr/local/go/bin/go test -v splitserver/splitserver_test.go -nodeOS="$nodeOS" -timeout=30m -json -ci | tee -a k3s_"$OS".log

echo 'RUNNING DOCKER CRI VALIDATION TEST'
/usr/local/go/bin/go test -v docker/docker_test.go -nodeOS="$nodeOS" -serverCount=1 -agentCount=1 -timeout=30m -json -ci | tee -a k3s_"$OS".log
echo 'RUNNING STARTUP VALIDATION TEST'
/usr/local/go/bin/go test -v startup/startup_test.go -nodeOS="$nodeOS" -timeout=30m -json -ci | tee -a k3s_"$OS".log

echo 'RUNNING EXTERNAL IP TEST'
/usr/local/go/bin/go test -v externalip/externalip_test.go -nodeOS="$nodeOS" -serverCount=1 -agentCount=1 -timeout=30m -json -ci | tee -a k3s_"$OS".log

echo 'RUNNING PRE-BUNDLED-BIN IP TEST'
/usr/local/go/bin/go test -v preferbundled/preferbundled_test.go -nodeOS="$nodeOS" -serverCount=1 -agentCount=1 -timeout=30m -json -ci | tee -a k3s_"$OS".log

echo 'RUNNING SNAPSHOT AND RESTORE TEST'
/usr/local/go/bin/go test -v snapshotrestore/snapshotrestore_test.go -nodeOS="$nodeOS" -serverCount=1 -agentCount=1 -timeout=30m -json -ci | tee -a k3s_"$OS".log

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ENV['VAGRANT_NO_PARALLEL'] = 'no'
NODE_ROLES = (ENV['E2E_NODE_ROLES'] ||
["server-0", "agent-0"])
NODE_BOXES = (ENV['E2E_NODE_BOXES'] ||
['generic/ubuntu2004', 'generic/ubuntu2004', 'generic/ubuntu2004'])
['generic/ubuntu2004', 'generic/ubuntu2004'])
GITHUB_BRANCH = (ENV['E2E_GITHUB_BRANCH'] || "master")
RELEASE_VERSION = (ENV['E2E_RELEASE_VERSION'] || "")
NODE_CPUS = (ENV['E2E_NODE_CPUS'] || 2).to_i
Expand All @@ -11,7 +11,6 @@ NODE_MEMORY = (ENV['E2E_NODE_MEMORY'] || 2048).to_i
NETWORK_PREFIX = "10.10.10"
install_type = ""


def provision(vm, role, role_num, node_num)
vm.box = NODE_BOXES[node_num]
vm.hostname = role
Expand All @@ -22,32 +21,33 @@ def provision(vm, role, role_num, node_num)
load vagrant_defaults if File.exists?(vagrant_defaults)

defaultOSConfigure(vm)
dockerInstall(vm)
install_type = getInstallType(vm, RELEASE_VERSION, GITHUB_BRANCH)
node_ip = "#{NETWORK_PREFIX}.#{100+node_num}"

vm.provision "shell", inline: "ping -c 2 k3s.io"

if role.include?("server")
vm.provision 'k3s-install', type: 'k3s', run: 'once' do |k3s|
k3s.args = "server"
k3s.env = %W[K3S_KUBECONFIG_MODE=0644 #{install_type}]
k3s.args = "server "
k3s.env = %W[K3S_KUBECONFIG_MODE=0644 #{install_type} INSTALL_K3S_SKIP_START=true]
k3s.config_mode = '0644' # side-step https://github.com/k3s-io/k3s/issues/4321
k3s.config = <<~YAML
token: vagrant
flannel-iface: eth1
node-external-ip: #{NETWORK_PREFIX}.100
prefer-bundled-bin: true
flannel-iface: eth1
YAML
end
elsif role.include?("agent")
vm.provision 'k3s-install', type: 'k3s', run: 'once' do |k3s|
k3s.args = "agent"
k3s.env = %W[K3S_KUBECONFIG_MODE=0644 K3S_TOKEN=vagrant #{install_type}]
k3s.args = "agent "
k3s.env = %W[K3S_KUBECONFIG_MODE=0644 #{install_type} INSTALL_K3S_SKIP_START=true]
k3s.config_mode = '0644' # side-step https://github.com/k3s-io/k3s/issues/4321
k3s.config = <<~YAML
server: "https://#{NETWORK_PREFIX}.100:6443"
token: vagrant
node-external-ip: #{node_ip}
flannel-iface: eth1
prefer-bundled-bin: true
YAML
end
end
Expand Down
Loading

0 comments on commit 7cad3db

Please sign in to comment.