From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- qa/workunits/cephadm/test_dashboard_e2e.sh | 113 +++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100755 qa/workunits/cephadm/test_dashboard_e2e.sh (limited to 'qa/workunits/cephadm/test_dashboard_e2e.sh') diff --git a/qa/workunits/cephadm/test_dashboard_e2e.sh b/qa/workunits/cephadm/test_dashboard_e2e.sh new file mode 100755 index 000000000..e6dfaa9ce --- /dev/null +++ b/qa/workunits/cephadm/test_dashboard_e2e.sh @@ -0,0 +1,113 @@ +#!/bin/bash -ex + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +DASHBOARD_FRONTEND_DIR=${SCRIPT_DIR}/../../../src/pybind/mgr/dashboard/frontend + +[ -z "$SUDO" ] && SUDO=sudo + +install_common () { + NODEJS_VERSION="16" + if grep -q debian /etc/*-release; then + $SUDO apt-get update + # https://github.com/nodesource/distributions#manual-installation + $SUDO apt-get install curl gpg + KEYRING=/usr/share/keyrings/nodesource.gpg + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | $SUDO tee "$KEYRING" >/dev/null + DISTRO="$(source /etc/lsb-release; echo $DISTRIB_CODENAME)" + VERSION="node_$NODEJS_VERSION.x" + echo "deb [signed-by=$KEYRING] https://deb.nodesource.com/$VERSION $DISTRO main" | $SUDO tee /etc/apt/sources.list.d/nodesource.list + echo "deb-src [signed-by=$KEYRING] https://deb.nodesource.com/$VERSION $DISTRO main" | $SUDO tee -a /etc/apt/sources.list.d/nodesource.list + $SUDO apt-get update + $SUDO apt-get install nodejs + elif grep -q rhel /etc/*-release; then + $SUDO yum module -y enable nodejs:$NODEJS_VERSION + $SUDO yum install -y jq npm + else + echo "Unsupported distribution." + exit 1 + fi +} + +install_chrome () { + if grep -q debian /etc/*-release; then + $SUDO bash -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list' + curl -fsSL https://dl.google.com/linux/linux_signing_key.pub | $SUDO apt-key add - + $SUDO apt-get update + $SUDO apt-get install -y google-chrome-stable + $SUDO apt-get install -y xvfb + $SUDO rm /etc/apt/sources.list.d/google-chrome.list + elif grep -q rhel /etc/*-release; then + $SUDO dd of=/etc/yum.repos.d/google-chrome.repo status=none < "${DASHBOARD_ADMIN_SECRET_FILE}" +ceph dashboard ac-user-set-password admin -i "${DASHBOARD_ADMIN_SECRET_FILE}" --force-password + +# Run Dashboard e2e tests. +# These tests are designed with execution order in mind, since orchestrator operations +# are likely to change cluster state, we can't just run tests in arbitrarily order. +# See /ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/ folder. +find cypress # List all specs + +cypress_run "orchestrator/01-hosts.e2e-spec.ts" + +# Hosts are removed and added in the previous step. Do a refresh again. +ceph orch device ls --refresh +sleep 10 +ceph orch device ls --format=json | tee cypress/fixtures/orchestrator/inventory.json + +cypress_run "orchestrator/03-inventory.e2e-spec.ts" +cypress_run "orchestrator/04-osds.e2e-spec.ts" 300000 -- cgit v1.2.3