From fb789a27efdb81b3baeb07e5519af3b4ae53e999 Mon Sep 17 00:00:00 2001 From: Juanadelacuesta <8647634+Juanadelacuesta@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:52:19 +0100 Subject: [PATCH] func: remove zip file --- enos/enos-quality.hcl | 43 +++++++++++++++++++ enos/modules/fetch_artifactory/main.tf | 2 +- .../fetch_artifactory/scripts/install.sh | 11 +++-- enos/modules/fetch_artifactory/variables.tf | 5 --- 4 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 enos/enos-quality.hcl diff --git a/enos/enos-quality.hcl b/enos/enos-quality.hcl new file mode 100644 index 00000000000..050d9e27eec --- /dev/null +++ b/enos/enos-quality.hcl @@ -0,0 +1,43 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + +quality "nomad_agent_info" { + description = "A GET call to /v1/agent/members returns the correct number of + running servers and they are all alive" +} + +quality "nomad_agent_info_self" { + description = "A GET call to /v1/agent/self against every server returns the + same last_log_index for all of them." +} + +quality "nomad_nodes_status" { + description = "A GET call to /v1/nodes returns the correct number of clients + and they are all `eligible` and `ready`". +} + +quality "nomad_job_status" { + description = "A GET call to /v1/jobs returns the correct number of jobs and + they are all `running`". +} + +quality "nomad_register_job" { + description = "A POST call to /v1/jobs results in a new job running and + allocations being started accordingly." +} + +quality "nomad_reschedule_alloc" { + description = "A POST / PUT call to /v1/allocation/:alloc_id/stop results in + the stopped allocation being rescheduled" +} + + +quality "nomad_restore_snapshot" { + description = "A node can be restored from a snapshot built on a previous + version" +} + +quality "nomad_allocs_status" { + description = "A GET call to /v1/allocs returns the correct number of + allocations and they are all `running`". +} diff --git a/enos/modules/fetch_artifactory/main.tf b/enos/modules/fetch_artifactory/main.tf index e380b07401c..b413f6b238b 100644 --- a/enos/modules/fetch_artifactory/main.tf +++ b/enos/modules/fetch_artifactory/main.tf @@ -29,4 +29,4 @@ resource "enos_local_exec" "install_binary" { } scripts = [abspath("${path.module}/scripts/install.sh")] -} \ No newline at end of file +} \ No newline at end of file diff --git a/enos/modules/fetch_artifactory/scripts/install.sh b/enos/modules/fetch_artifactory/scripts/install.sh index 9aed88ed48f..a7f9c24ae14 100755 --- a/enos/modules/fetch_artifactory/scripts/install.sh +++ b/enos/modules/fetch_artifactory/scripts/install.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 @@ -8,9 +8,9 @@ set -xeuo pipefail LOCAL_ZIP="nomad.zip" # Name for the downloaded file # Download the file -wget --header="X-JFrog-Art-Api:$TOKEN" -O- "$LOCAL_ZIP" "$URL" +wget --header="X-JFrog-Art-Api:$TOKEN" -O "$LOCAL_ZIP" "$URL" -# Check if the file was downloaded +#Check if the file was downloaded if [ $? -eq 0 ]; then echo "File downloaded successfully: $LOCAL_ZIP" else @@ -30,4 +30,7 @@ if [ $? -eq 0 ]; then else echo "Error unzipping file." >&2 exit 1 -fi \ No newline at end of file +fi + +# Remove the zipped file +rm "$LOCAL_ZIP" \ No newline at end of file diff --git a/enos/modules/fetch_artifactory/variables.tf b/enos/modules/fetch_artifactory/variables.tf index b5c7c96596d..9c51b5f3d63 100644 --- a/enos/modules/fetch_artifactory/variables.tf +++ b/enos/modules/fetch_artifactory/variables.tf @@ -31,11 +31,6 @@ variable "edition" { description = "The edition of the binary to search, it can be either CE or ENT" } -variable "revision" { - type = string - description = "The specific commit of the binary" -} - variable "os" { type = string description = "The operative system the binary is needed for"