From 59fa3e3c21fd2c896da2d3272604509ea9a55a91 Mon Sep 17 00:00:00 2001 From: Samruddhi Khandale Date: Mon, 9 Jan 2023 14:49:43 -0800 Subject: Conda: Update 'certifi' due to CVE-2022-23491 (#383) --- test/conda/test.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/conda/test.sh') diff --git a/test/conda/test.sh b/test/conda/test.sh index f300217..8a88511 100755 --- a/test/conda/test.sh +++ b/test/conda/test.sh @@ -12,5 +12,25 @@ check "if conda-notice.txt exists" cat /usr/local/etc/vscode-dev-containers/cond # Check env check "CONDA_SCRIPT is set correctly" echo $CONDA_SCRIPT | grep "/opt/conda/etc/profile.d/conda.sh" +check-version-ge() { + LABEL=$1 + CURRENT_VERSION=$2 + REQUIRED_VERSION=$3 + shift + echo -e "\n🧪 Testing $LABEL: '$CURRENT_VERSION' is >= '$REQUIRED_VERSION'" + local GREATER_VERSION=$((echo ${CURRENT_VERSION}; echo ${REQUIRED_VERSION}) | sort -V | tail -1) + if [ "${CURRENT_VERSION}" == "${GREATER_VERSION}" ]; then + echo "✅ Passed!" + return 0 + else + echoStderr "❌ $LABEL check failed." + FAILED+=("$LABEL") + return 1 + fi +} + +certifiVersion=$(python -c "import certifi; print(certifi.__version__)") +check-version-ge "certifi" "${certifiVersion}" "2022.12.07" + # Report result reportResults -- cgit v1.2.3