Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
34e51ac1
Unverified
Commit
34e51ac1
authored
5 years ago
by
Maxime Guyot
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add a test to check that nodes are Ready (#5793)
parent
d152dc2e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/scripts/testcases_run.sh
+3
-0
3 additions, 0 deletions
tests/scripts/testcases_run.sh
tests/testcases/020_check-nodes-ready.yml
+30
-0
30 additions, 0 deletions
tests/testcases/020_check-nodes-ready.yml
with
33 additions
and
0 deletions
tests/scripts/testcases_run.sh
+
3
−
0
View file @
34e51ac1
...
@@ -60,6 +60,9 @@ ansible-playbook -e ansible_python_interpreter=${PYPATH} --limit "all:!fake_host
...
@@ -60,6 +60,9 @@ ansible-playbook -e ansible_python_interpreter=${PYPATH} --limit "all:!fake_host
## Test that all pods are Running
## Test that all pods are Running
ansible-playbook
-e
ansible_python_interpreter
=
${
PYPATH
}
--limit
"all:!fake_hosts"
tests/testcases/015_check-pods-running.yml
$LOG_LEVEL
ansible-playbook
-e
ansible_python_interpreter
=
${
PYPATH
}
--limit
"all:!fake_hosts"
tests/testcases/015_check-pods-running.yml
$LOG_LEVEL
## Test that all nodes are Ready
ansible-playbook
-e
ansible_python_interpreter
=
${
PYPATH
}
--limit
"all:!fake_hosts"
tests/testcases/020_check-nodes-ready.yml
$LOG_LEVEL
## Test pod creation and ping between them
## Test pod creation and ping between them
ansible-playbook
-e
ansible_python_interpreter
=
${
PYPATH
}
--limit
"all:!fake_hosts"
tests/testcases/030_check-network.yml
$LOG_LEVEL
ansible-playbook
-e
ansible_python_interpreter
=
${
PYPATH
}
--limit
"all:!fake_hosts"
tests/testcases/030_check-network.yml
$LOG_LEVEL
...
...
This diff is collapsed.
Click to expand it.
tests/testcases/020_check-nodes-ready.yml
0 → 100644
+
30
−
0
View file @
34e51ac1
---
-
hosts
:
kube-master[0]
tasks
:
-
name
:
Force binaries directory for Container Linux by CoreOS and Flatcar
set_fact
:
bin_dir
:
"
/opt/bin"
when
:
ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS", "Flatcar", "Flatcar Container Linux by Kinvolk"]
-
name
:
Force binaries directory for other hosts
set_fact
:
bin_dir
:
"
/usr/local/bin"
when
:
not ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS", "Flatcar", "Flatcar Container Linux by Kinvolk"]
-
name
:
Check kubectl output
shell
:
"
{{
bin_dir
}}/kubectl
get
nodes"
register
:
get_nodes
no_log
:
true
-
debug
:
msg
:
"
{{
get_nodes.stdout.split('
\n
')
}}"
-
name
:
Check that all nodes are running and ready
shell
:
"
{{
bin_dir
}}/kubectl
get
nodes
--no-headers
-o
yaml"
register
:
get_nodes_yaml
until
:
# Check that all nodes are Status=Ready
-
'
(get_nodes_yaml.stdout
|
from_yaml)["items"]
|
map(attribute
=
"status.conditions")
|
map("items2dict",
key_name="type",
value_name="status")
|
map(attribute="Ready")
|
list
|
min'
retries
:
30
delay
:
10
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment