k8s: Change virtual environment utility scripts privilege requirements 46/91946/1
authorPawel Wieczorek <p.wieczorek2@samsung.com>
Wed, 24 Jul 2019 12:19:46 +0000 (14:19 +0200)
committerPawel Wieczorek <p.wieczorek2@samsung.com>
Wed, 24 Jul 2019 13:55:56 +0000 (15:55 +0200)
This patch also extends in-file comment on scripts' requirements and
suggested usage.

Issue-ID: SECCOM-235
Change-Id: I0dddbad79fb3392ffe35c3e06d4006cd499d9923
Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
test/security/k8s/tools/casablanca/get_ranchercli.sh
test/security/k8s/tools/dublin/get_rke.sh

index 76d5594..8ffbc5f 100755 (executable)
@@ -1,5 +1,23 @@
 #!/usr/bin/env bash
 
+#
+# @file        test/security/k8s/tools/casablanca/get_ranchercli.sh
+# @author      Pawel Wieczorek <p.wieczorek2@samsung.com>
+# @brief       Utility for obtaining Rancher CLI tool
+#
+
+# Dependencies:
+#     wget
+#     tar
+#     coreutils
+#
+# Privileges:
+# Script expects to be run with administrative privileges for accessing /usr/local/bin
+#
+# Usage:
+# # ./get_ranchercli.sh [VERSION [ARCH [SYSTEM]]]
+#
+
 # Constants
 DEFAULT_VERSION='v0.6.12'
 DEFAULT_ARCH='amd64'
@@ -20,8 +38,7 @@ wget "$URL"
 tar xf "$ARCHIVE"
 
 # Installation
-echo '# Privilege elevation needed to move Rancher CLI binary to /usr/local/bin'
-sudo mv "${DIRECTORY}/rancher" /usr/local/bin/
+mv "${DIRECTORY}/rancher" /usr/local/bin/
 
 # Cleanup
 rmdir "$DIRECTORY"
index ffa5c70..63ef8c7 100755 (executable)
@@ -1,5 +1,22 @@
 #!/usr/bin/env bash
 
+#
+# @file        test/security/k8s/tools/dublin/get_rke.sh
+# @author      Pawel Wieczorek <p.wieczorek2@samsung.com>
+# @brief       Utility for obtaining RKE tool
+#
+
+# Dependencies:
+#     wget
+#     coreutils
+#
+# Privileges:
+# Script expects to be run with administrative privileges for accessing /usr/local/bin
+#
+# Usage:
+# # ./get_rke.sh [VERSION [ARCH [SYSTEM]]]
+#
+
 # Constants
 DEFAULT_VERSION='v0.2.1'
 DEFAULT_ARCH='amd64'
@@ -19,5 +36,4 @@ wget "$URL"
 chmod +x "${BINARY}"
 
 # Installation
-echo '# Privilege elevation needed to move RKE binary to /usr/local/bin'
-sudo mv "${BINARY}" "/usr/local/bin/${BINARY%%_*}" # this also renames binary to "rke"
+mv "${BINARY}" "/usr/local/bin/${BINARY%%_*}" # this also renames binary to "rke"