Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
462434a5
Commit
462434a5
authored
Jan 06, 2022
by
Brad Davidson
Committed by
Brad Davidson
Jan 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basic etcd join test
Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
7f271e4e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
+48
-0
test
scripts/test
+3
-0
test-run-etcd
scripts/test-run-etcd
+45
-0
No files found.
scripts/test
View file @
462434a5
...
...
@@ -21,6 +21,9 @@ echo "Did test-run-basics $?"
.
./scripts/test-run-compat
echo
"Did test-run-compat
$?
"
.
./scripts/test-run-etcd
echo
"Did test-run-etcd
$?
"
# ---
[
"
$ARCH
"
!=
'amd64'
]
&&
\
...
...
scripts/test-run-etcd
0 → 100755
View file @
462434a5
#!/bin/bash
all_services
=(
coredns
local-path-provisioner
metrics-server
traefik
)
export
NUM_SERVERS
=
2
export
NUM_AGENTS
=
0
export
WAIT_SERVICES
=
"
${
all_services
[@]
}
"
export
SERVER_1_ARGS
=
"--cluster-init"
server-post-hook
()
{
if
[
$1
-eq
1
]
;
then
local
url
=
$(
cat
$TEST_DIR
/servers/1/metadata/url
)
export
SERVER_ARGS
=
"
${
SERVER_ARGS
}
--server
$url
"
fi
}
export
-f
server-post-hook
export
-f
server-post-hook
start-test
()
{
echo
"Cluster is up"
}
export
-f
start-test
# --- create a basic cluster to test joining managed etcd
LABEL
=
"ETCD-JOIN-BASIC"
SERVER_ARGS
=
""
run-test
# --- create a basic cluster to test joining a managed etcd cluster with --agent-token set
LABEL
=
"ETCD-JOIN-AGENTTOKEN"
SERVER_ARGS
=
"--agent-token
${
RANDOM
}${
RANDOM
}${
RANDOM
}
"
run-test
# --- test joining a managed etcd cluster with incompatible configuration
test-post-hook
()
{
if
[[
$1
-eq
0
]]
;
then
return
fi
grep
-sqF
'critical configuration value mismatch'
$TEST_DIR
/servers/2/logs/system.log
}
export
-f
test-post-hook
LABEL
=
"ETCD-JOIN-MISMATCH"
SERVER_2_ARGS
=
"--cluster-cidr 10.0.0.0/16"
run-test
cleanup-test-env
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment