Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 3.15.214.238
Web Server : Apache/2.4.62 (Debian)
System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.18
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/ansible_collections/community/okd/ci/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /lib/python3/dist-packages/ansible_collections/community/okd/ci//incluster_integration.sh
#!/bin/bash -eu

set -x

NAMESPACE=${NAMESPACE:-default}

# IMAGE_FORMAT is in the form $registry/$org/$image:$$component, ie
# quay.io/openshift/release:$component
# To test with your own image, build and push the test image
# (using the Dockerfile in ci/Dockerfile)
# and set the IMAGE_FORMAT environment variable so that it properly
# resolves to your image. For example, quay.io/mynamespace/$component
# would resolve to quay.io/mynamespace/molecule-test-runner
# shellcheck disable=SC2034
component='molecule-test-runner'
if [[ -n "${MOLECULE_IMAGE}" ]]; then
  IMAGE="${MOLECULE_IMAGE}"
else
  IMAGE="${IMAGE_FORMAT}"
fi

PULL_POLICY=${PULL_POLICY:-IfNotPresent}

if ! oc get namespace "$NAMESPACE"
then
  oc create namespace "$NAMESPACE"
fi

oc project "$NAMESPACE"
oc adm policy add-cluster-role-to-user cluster-admin -z default
oc adm policy who-can create projectrequests

echo "Deleting test job if it exists"
oc delete job molecule-integration-test --wait --ignore-not-found

echo "Creating molecule test job"
cat << EOF | oc create -f -
---
apiVersion: batch/v1
kind: Job
metadata:
  name: molecule-integration-test
spec:
  template:
    spec:
      containers:
        - name: test-runner
          image: ${IMAGE}
          imagePullPolicy: ${PULL_POLICY}
          command:
            - make
            - test-integration
      restartPolicy: Never
  backoffLimit: 2
  completions: 1
  parallelism: 1
EOF

function check_success {
  oc wait --for=condition=complete job/molecule-integration-test --timeout 5s -n "$NAMESPACE" \
   && oc logs job/molecule-integration-test \
   && echo "Molecule integration tests ran successfully" \
   && return 0
  return 1
}

function check_failure {
  oc wait --for=condition=failed job/molecule-integration-test --timeout 5s -n "$NAMESPACE" \
   && oc logs job/molecule-integration-test \
   && echo "Molecule integration tests failed, see logs for more information..." \
   && return 0
  return 1
}

runtime="30 minute"
endtime=$(date -ud "$runtime" +%s)

echo "Waiting for test job to complete"
while [[ $(date -u +%s) -le $endtime ]]
do
  if check_success
  then
    exit 0
  elif check_failure
  then
    exit 1
  fi
  sleep 10
done

oc logs job/molecule-integration-test
exit 1

Anon7 - 2022
AnonSec Team