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
c01fec0c
Unverified
Commit
c01fec0c
authored
Mar 10, 2020
by
Erik Wilson
Committed by
GitHub
Mar 10, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1515 from erikwilson/airgap-test
Testing - Check for changes in the airgap image list
parents
c74f745a
d95707e2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
26 deletions
+59
-26
.gitignore
.gitignore
+1
-0
image-list.txt
scripts/airgap/image-list.txt
+2
-2
test
scripts/test
+7
-8
test-helpers
scripts/test-helpers
+23
-15
test-run-basics
scripts/test-run-basics
+26
-1
No files found.
.gitignore
View file @
c01fec0c
...
@@ -28,3 +28,4 @@ __pycache__
...
@@ -28,3 +28,4 @@ __pycache__
/tests/.tox/
/tests/.tox/
/tests/.vscode
/tests/.vscode
/sonobuoy-output
/sonobuoy-output
*.tmp
scripts/airgap/image-list.txt
View file @
c01fec0c
docker.io/coredns/coredns:1.6.3
docker.io/coredns/coredns:1.6.3
docker.io/k3sio/k8s-defaultbackend:1.5
docker.io/k3sio/nginx-ingress-controller:0.30.0
docker.io/rancher/klipper-helm:v0.2.3
docker.io/rancher/klipper-helm:v0.2.3
docker.io/rancher/klipper-lb:v0.1.2
docker.io/rancher/klipper-lb:v0.1.2
docker.io/rancher/local-path-provisioner:v0.0.11
docker.io/rancher/local-path-provisioner:v0.0.11
docker.io/rancher/metrics-server:v0.3.6
docker.io/rancher/metrics-server:v0.3.6
docker.io/rancher/pause:3.1
docker.io/rancher/pause:3.1
docker.io/k3sio/nginx-ingress-controller:0.30.0
\ No newline at end of file
scripts/test
View file @
c01fec0c
...
@@ -13,19 +13,18 @@ mkdir -p $artifacts
...
@@ -13,19 +13,18 @@ mkdir -p $artifacts
# ---
# ---
[
"
$ARCH
"
=
'arm'
]
&&
\
early-exit
"Skipping sonobuoy, images not available for
$ARCH
."
E2E_OUTPUT
=
$artifacts
test-run-sonobuoy
E2E_OUTPUT
=
$artifacts
test-run-sonobuoy
# ---
# ---
if
[
"
$DRONE_BUILD_EVENT
"
=
'tag'
]
;
then
[
"
$DRONE_BUILD_EVENT
"
=
'tag'
]
&&
\
printf
"
\0
33[33mSkipping remaining tests on tag.
\0
33[m
\n
"
early-exit
'Skipping remaining tests on tag.'
exit
0
fi
if
[
"
$ARCH
"
!=
'amd64'
]
;
then
[
"
$ARCH
"
!=
'amd64'
]
&&
\
printf
"
\0
33[33mSkipping remaining tests, images not available for
$ARCH
.
\0
33[m
\n
"
early-exit
"Skipping remaining tests, images not available for
$ARCH
."
exit
0
fi
# ---
# ---
...
...
scripts/test-helpers
View file @
c01fec0c
...
@@ -437,6 +437,14 @@ export -f provision-cluster
...
@@ -437,6 +437,14 @@ export -f provision-cluster
# ---
# ---
early-exit
()
{
printf
"
\0
33[33m
$1
\0
33[m
\n
"
exit
$2
}
export
-f
early-exit
# ---
run-test
()
{
run-test
()
{
export
PROVISION_LOCK
=
$(
mktemp
)
export
PROVISION_LOCK
=
$(
mktemp
)
./scripts/test-runner
$@
&
./scripts/test-runner
$@
&
...
@@ -454,27 +462,27 @@ export -f run-test
...
@@ -454,27 +462,27 @@ export -f run-test
# ---
# ---
e2e-test
()
{
e2e-test
()
{
local
label
=
$label
local
label
=
$label
if
[
-n
"
$LABEL_SUFFIX
"
]
;
then
if
[
-n
"
$LABEL_SUFFIX
"
]
;
then
label
=
"
$label
-
$LABEL_SUFFIX
"
label
=
"
$label
-
$LABEL_SUFFIX
"
fi
fi
local
logOutput
=
local
logOutput
=
if
[
-n
"
$E2E_OUTPUT
"
]
;
then
if
[
-n
"
$E2E_OUTPUT
"
]
;
then
logOutput
=
$E2E_OUTPUT
/
$logName
logOutput
=
$E2E_OUTPUT
/
$logName
fi
fi
LABEL
=
$label
LOG_OUTPUT
=
$logOutput
run-test
$@
LABEL
=
$label
LOG_OUTPUT
=
$logOutput
run-test
$@
}
}
# ---
# ---
run-e2e-tests
()
{
run-e2e-tests
()
{
label
=
PARALLEL
\
label
=
PARALLEL
\
logName
=
e2e-STATUS-
${
ARCH
}
-parallel
.log
\
logName
=
e2e-STATUS-
${
ARCH
}
-parallel
.log
\
e2e-test
${
sonobuoyParallelArgs
[@]
}
e2e-test
${
sonobuoyParallelArgs
[@]
}
label
=
SERIAL
\
label
=
SERIAL
\
logName
=
e2e-STATUS-
${
ARCH
}
-serial
.log
\
logName
=
e2e-STATUS-
${
ARCH
}
-serial
.log
\
e2e-test
${
sonobuoySerialArgs
[@]
}
e2e-test
${
sonobuoySerialArgs
[@]
}
}
}
export
-f
run-e2e-tests
export
-f
run-e2e-tests
...
...
scripts/test-run-basics
View file @
c01fec0c
#!/bin/bash
#!/bin/bash
all_services
=(
coredns
local-path-provisioner
metrics-server
nginx-ingress-controller
nginx-ingress-default-backend
)
export
NUM_SERVERS
=
1
export
NUM_SERVERS
=
1
export
NUM_AGENTS
=
1
export
NUM_AGENTS
=
1
export
SERVER_ARGS
=
'--no-deploy=traefik,coredns,local-storage,metrics-server'
export
WAIT_SERVICES
=
"
${
all_services
[@]
}
"
start-test
()
{
start-test
()
{
docker
exec
$(
cat
$TEST_DIR
/servers/1/metadata/name
)
check-config
||
true
docker
exec
$(
cat
$TEST_DIR
/servers/1/metadata/name
)
check-config
||
true
verify-valid-versions
$(
cat
$TEST_DIR
/servers/1/metadata/name
)
verify-valid-versions
$(
cat
$TEST_DIR
/servers/1/metadata/name
)
verify-airgap-images
$(
cat
$TEST_DIR
/
{
servers,agents
}
/
*
/metadata/name
)
}
}
export
-f
start-test
export
-f
start-test
# -- check for changes to the airgap image list
verify-airgap-images
()
{
local
airgap_image_list
=
'scripts/airgap/image-list.txt'
for
name
in
$@
;
do
docker
exec
$name
crictl images
-o
json
\
| jq
-r
'.images[].repoTags[0] | select(. != null)'
done
|
sort
-u
>
$airgap_image_list
.tmp
if
!
diff
$airgap_image_list
{
,.tmp
}
;
then
echo
'[ERROR] Failed airgap image check'
return
1
fi
}
export
-f
verify-airgap-images
# --- create a basic cluster and check for valid versions
# --- create a basic cluster and check for valid versions
LABEL
=
BASICS run-test
LABEL
=
BASICS run-test
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