Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Lukáš Doktor <[email protected]>
  • Loading branch information
ldoktor committed Aug 8, 2024
1 parent 7f5fbe0 commit c094bc4
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 7 deletions.
28 changes: 27 additions & 1 deletion .github/workflows/ccruntime_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,33 @@ jobs:

- name: Install deps
run: |
mount
df -h
sudo apt-get update -y
sudo apt-get remove docker* containerd* -y
#sudo apt-get remove haveged* heroku* mediainfo* mercurial* microsoft* firefox* google* mono* r-* azure* php* mysql* mssql* postgresql* powershell*
sudo rm -Rf /usr/local/share/chromium
sudo rm -Rf /usr/local/share/powershell
sudo du -hs /usr/local/share/* || true
sudo du -hs /mnt/* || true
sudo rm -Rf /var/lib/docker || true
sudo mkdir /mnt/docker || true
sudo ln -s /mnt/docker /var/lib/docker || true
#sudo rm -Rf /run/containerd
#sudo mkdir /mnt/containerd
#sudo ln -s /mnt/containerd /run/containerd
mount
df -h
#ls -al /var/run/
#sudo chmod 777 /var/run/docker.sock
#which docker
#docker version
#systemctl status docker
#sudo systemctl start docker
#systemctl status docker
#sudo pip3 install -U requests==2.20.1 docker==3.1.1
sudo apt-get install -y ansible python-is-python3
shell: /usr/bin/bash -x {0}

- name: Run e2e tests
timeout-minutes: 45
Expand All @@ -48,7 +73,8 @@ jobs:
if [ $RUNNING_INSTANCE = "s390x" ]; then
args=""
fi
./run-local.sh -t -r "${{ matrix.runtimeclass }}" "${args}"
bash -x ./run-local.sh -t -r "${{ matrix.runtimeclass }}" "${args}" || true
df -h
env:
RUNNING_INSTANCE: ${{ matrix.instance }}
GITHUB_TOKEN: ${{ github.token }}
25 changes: 24 additions & 1 deletion tests/e2e/operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ install_ccruntime() {
cmd+="egrep -q ${pod}.*'\<Running\>'"
if ! wait_for_process 600 30 "$cmd"; then
echo "::error:: $pod pod is not running"
kubectl get all -o yaml
echo "::error:: NS"
kubectl get all -n "$op_ns" -o yaml
local pod_id
pod_id="$(get_pods_regex "$pod" "$op_ns")"
echo "::debug:: Pod $pod_id"
Expand Down Expand Up @@ -171,7 +174,7 @@ uninstall_ccruntime() {
local cmd="_OUT=\$(sudo -E kubectl get pods -n '$op_ns')"
cmd+=" && ! echo \$_OUT | grep -q -e cc-operator-daemon-install"
cmd+=" -e cc-operator-pre-install-daemon"
if ! wait_for_process 720 30 "$cmd"; then
if ! wait_for_process 180 30 "$cmd"; then
echo "::error:: there are ccruntime pods still running"
echo "::group::Describe pods from $op_ns namespace"
kubectl -n "$op_ns" describe pods || true
Expand Down Expand Up @@ -291,6 +294,26 @@ wait_for_stabilization() {
((count+=1))
sleep 21
done
echo "::info:: LDOKTOR"
kubectl -n "$op_ns" get all -o yaml
sleep 3m
echo "::info:: LDOKTOR"
echo
echo cc-operator-pre-install-daemon
echo
kubectl logs -n "$op_ns" ds/cc-operator-pre-install-daemon || true
echo
echo cc-operator-daemon-install
echo
kubectl logs -n "$op_ns" ds/cc-operator-daemon-install || true
echo
echo
df -h
timeout 360 bash -x "${script_dir}/operator.sh" uninstall || echo "::error:: LDOKTOR - uninstall 1 failed"
timeout 360 bash -x "${script_dir}/operator.sh" uninstall || echo "::error:: LDOKTOR - uninstall 2 failed"
timeout 360 bash -x "${script_dir}/operator.sh" uninstall || echo "::error:: LDOKTOR - uninstall 3 failed"
timeout 360 bash -x "${script_dir}/operator.sh" uninstall || echo "::error:: LDOKTOR - uninstall 4 failed"
timeout 360 bash -x "${script_dir}/operator.sh" uninstall || echo "::error:: LDOKTOR - uninstall 5 failed"
}


Expand Down
10 changes: 5 additions & 5 deletions tests/e2e/run-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,23 @@ main() {
pushd "$script_dir" >/dev/null
echo "::info:: Bootstrap the local machine"
step_bootstrap_env=1
run 10m ansible-playbook -i localhost, -c local --tags untagged ansible/main.yaml
run 10m ansible-playbook -vvv -i localhost, -c local --tags untagged ansible/main.yaml

echo "::info:: Bring up the test cluster"
step_start_cluster=1
run 10m sudo -E PATH="$PATH" bash -c './cluster/up.sh'
run 10m sudo -E PATH="$PATH" bash -x -c './cluster/up.sh'
export KUBECONFIG=/etc/kubernetes/admin.conf

echo "::info:: Build and install the operator"
step_install_operator=1
run 20m sudo -E PATH="$PATH" bash -c './operator.sh'
run 20m sudo -E PATH="$PATH" bash -x -c './operator.sh'

echo "::info:: Run tests"
local cmd="run 20m sudo -E PATH=\"$PATH\" bash -c "
if [ -z "$runtimeclass" ]; then
cmd+="'./tests_runner.sh'"
cmd+="'bash -x ./tests_runner.sh'"
else
cmd+="'./tests_runner.sh -r $runtimeclass'"
cmd+="'bash -x ./tests_runner.sh -r $runtimeclass'"
fi
eval $cmd
popd >/dev/null
Expand Down

0 comments on commit c094bc4

Please sign in to comment.