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
8a6404f9
Commit
8a6404f9
authored
Jan 13, 2023
by
Brad Davidson
Committed by
Brad Davidson
Feb 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basic test for custom CA certs
Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
9b6b7294
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
test
scripts/test
+3
-0
test-run-cacerts
scripts/test-run-cacerts
+50
-0
No files found.
scripts/test
View file @
8a6404f9
...
@@ -23,6 +23,9 @@ echo "Did test-run-compat $?"
...
@@ -23,6 +23,9 @@ echo "Did test-run-compat $?"
.
./scripts/test-run-hardened
.
./scripts/test-run-hardened
echo
"Did test-run-hardened
$?
"
echo
"Did test-run-hardened
$?
"
.
./scripts/test-run-cacerts
echo
"Did test-run-cacerts
$?
"
.
./scripts/test-run-upgrade
.
./scripts/test-run-upgrade
echo
"Did test-run-upgrade
$?
"
echo
"Did test-run-upgrade
$?
"
...
...
scripts/test-run-cacerts
0 → 100755
View file @
8a6404f9
#!/bin/bash
all_services
=(
coredns
local-path-provisioner
metrics-server
traefik
)
export
NUM_SERVERS
=
1
export
NUM_AGENTS
=
1
export
WAIT_SERVICES
=
"
${
all_services
[@]
}
"
# -- This test runs in docker mounting the docker socket,
# -- so we can't directly mount files into the test containers. Instead we have to
# -- run a dummy container with a volume, copy files into that volume, and then
# -- share it with the other containers that need the file.
cluster-pre-hook
()
{
mkdir
-p
$TEST_DIR
/pause/0/metadata
local
testID
=
$(
basename
$TEST_DIR
)
local
name
=
$(
echo
"k3s-pause-0-
${
testID
,,
}
"
|
tee
$TEST_DIR
/pause/0/metadata/name
)
export
SERVER_DOCKER_ARGS
=
"--mount type=volume,src=
$name
,dst=/var/lib/rancher/k3s/server/tls"
docker run
\
-d
--name
$name
\
--hostname
$name
\
${
SERVER_DOCKER_ARGS
}
\
rancher/mirrored-pause:3.6
\
>
/dev/null
DATA_DIR
=
"
$TEST_DIR
/pause/0/k3s"
./contrib/util/certs.sh
docker
cp
"
$TEST_DIR
/pause/0/k3s"
$name
:/var/lib/rancher
}
export
-f
cluster-pre-hook
start-test
()
{
echo
"Cluster is up with custom CA certs"
}
export
-f
start-test
test-cleanup-hook
(){
local
testID
=
$(
basename
$TEST_DIR
)
docker volume
ls
-q
|
grep
-F
${
testID
,,
}
| xargs
-r
docker volume
rm
}
export
-f
test-cleanup-hook
# --- create a basic cluster and check for functionality
LABEL
=
CUSTOM-CA-CERTS 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