summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hansen <rhansen@rhansen.org>2016-01-23 03:23:05 -0500
committerRichard Hansen <rhansen@rhansen.org>2016-01-31 16:13:56 -0500
commit57f1ad53e202861f2f7c858f970782a2351dcb76 (patch)
tree971e880cc11f712ffe979310b48b1d198a1da19c
parent09ef2538bde7486e3327784c5968c5ee2482394b (diff)
downloadgitlab-57f1ad53e202861f2f7c858f970782a2351dcb76.tar.gz
convert scripts to POSIX shell by eliminating bashisms
-rwxr-xr-xtools/build_test_env.sh6
-rwxr-xr-xtools/functional_tests.sh26
-rwxr-xr-xtools/py_functional_tests.sh2
3 files changed, 17 insertions, 17 deletions
diff --git a/tools/build_test_env.sh b/tools/build_test_env.sh
index 9788d57..c824107 100755
--- a/tools/build_test_env.sh
+++ b/tools/build_test_env.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# Copyright (C) 2016 Gauvain Pocentek <gauvain@pocentek.net>
#
# This program is free software: you can redistribute it and/or modify
@@ -71,7 +71,7 @@ CONFIG=/tmp/python-gitlab.cfg
GITLAB() { gitlab --config-file "$CONFIG" "$@"; }
GREEN='\033[0;32m'
NC='\033[0m'
-OK() { echo -e "${GREEN}OK${NC}"; }
+OK() { printf "${GREEN}OK${NC}\\n"; }
log "Waiting for gitlab to come online... "
I=0
@@ -81,7 +81,7 @@ while :; do
sleep 4
curl -s http://localhost:8080/users/sign_in 2>/dev/null \
| grep -q "GitLab Community Edition" && break
- let I=I+5
+ I=$((I+5))
[ "$I" -eq 120 ] && exit 1
done
sleep 5
diff --git a/tools/functional_tests.sh b/tools/functional_tests.sh
index cf9c632..2ad0219 100755
--- a/tools/functional_tests.sh
+++ b/tools/functional_tests.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# Copyright (C) 2015 Gauvain Pocentek <gauvain@pocentek.net>
#
# This program is free software: you can redistribute it and/or modify
@@ -20,61 +20,61 @@ BUILD_TEST_ENV_AUTO_CLEANUP=true
set -e
-echo -n "Testing project creation... "
+printf %s "Testing project creation... "
PROJECT_ID=$(GITLAB project create --name test-project1 \
| grep ^id: | cut -d' ' -f2)
GITLAB project list | grep -q test-project1
OK
-echo -n "Testing project update... "
+printf %s "Testing project update... "
GITLAB project update --id "$PROJECT_ID" --description "My New Description"
OK
-echo -n "Testing user creation... "
+printf %s "Testing user creation... "
USER_ID=$(GITLAB user create --email fake@email.com --username user1 \
--name "User One" --password fakepassword | grep ^id: | cut -d' ' -f2)
OK
-echo -n "Testing verbose output... "
+printf %s "Testing verbose output... "
GITLAB -v user list | grep -q avatar-url
OK
-echo -n "Testing CLI args not in output... "
+printf %s "Testing CLI args not in output... "
GITLAB -v user list | grep -qv config-file
OK
-echo -n "Testing adding member to a project... "
+printf %s "Testing adding member to a project... "
GITLAB project-member create --project-id "$PROJECT_ID" \
--user-id "$USER_ID" --access-level 40 >/dev/null 2>&1
OK
-echo -n "Testing file creation... "
+printf %s "Testing file creation... "
GITLAB project-file create --project-id "$PROJECT_ID" \
--file-path README --branch-name master --content "CONTENT" \
--commit-message "Initial commit" >/dev/null 2>&1
OK
-echo -n "Testing issue creation... "
+printf %s "Testing issue creation... "
ISSUE_ID=$(GITLAB project-issue create --project-id "$PROJECT_ID" \
--title "my issue" --description "my issue description" \
| grep ^id: | cut -d' ' -f2)
OK
-echo -n "Testing note creation... "
+printf %s "Testing note creation... "
GITLAB project-issue-note create --project-id "$PROJECT_ID" \
--issue-id "$ISSUE_ID" --body "the body" >/dev/null 2>&1
OK
-echo -n "Testing branch creation... "
+printf %s "Testing branch creation... "
GITLAB project-branch create --project-id "$PROJECT_ID" \
--branch-name branch1 --ref master >/dev/null 2>&1
OK
-echo -n "Testing branch deletion... "
+printf %s "Testing branch deletion... "
GITLAB project-branch delete --project-id "$PROJECT_ID" \
--name branch1 >/dev/null 2>&1
OK
-echo -n "Testing project deletion... "
+printf %s "Testing project deletion... "
GITLAB project delete --id "$PROJECT_ID"
OK
diff --git a/tools/py_functional_tests.sh b/tools/py_functional_tests.sh
index b6e9597..4538541 100755
--- a/tools/py_functional_tests.sh
+++ b/tools/py_functional_tests.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# Copyright (C) 2015 Gauvain Pocentek <gauvain@pocentek.net>
#
# This program is free software: you can redistribute it and/or modify