diff options
author | Alexey Neyman <stilor@att.net> | 2018-04-15 14:29:09 -0700 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2018-04-15 14:29:09 -0700 |
commit | 715d6376bf87e102fd8a46af2f18dcc83ca913e0 (patch) | |
tree | 004f2d724771e2bf5e1e8ee165923199fb46cb2b /testing/docker/common-scripts | |
parent | 5472517b31bde9b1ab71fd3369f3370e813e0351 (diff) | |
download | crosstool-ng-715d6376bf87e102fd8a46af2f18dcc83ca913e0.tar.gz crosstool-ng-715d6376bf87e102fd8a46af2f18dcc83ca913e0.tar.bz2 crosstool-ng-715d6376bf87e102fd8a46af2f18dcc83ca913e0.zip |
First stab at docker-based test framework
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'testing/docker/common-scripts')
-rwxr-xr-x | testing/docker/common-scripts/ctng-build-all | 10 | ||||
-rwxr-xr-x | testing/docker/common-scripts/ctng-install | 10 | ||||
-rwxr-xr-x | testing/docker/common-scripts/su-as-user | 15 |
3 files changed, 35 insertions, 0 deletions
diff --git a/testing/docker/common-scripts/ctng-build-all b/testing/docker/common-scripts/ctng-build-all new file mode 100755 index 00000000..f29093a9 --- /dev/null +++ b/testing/docker/common-scripts/ctng-build-all @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e +cd +rm -rf bld-ctng +mkdir bld-ctng +cd bld-ctng +/crosstool-ng/configure --prefix=$HOME/inst-ctng +make +make install diff --git a/testing/docker/common-scripts/ctng-install b/testing/docker/common-scripts/ctng-install new file mode 100755 index 00000000..f29093a9 --- /dev/null +++ b/testing/docker/common-scripts/ctng-install @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e +cd +rm -rf bld-ctng +mkdir bld-ctng +cd bld-ctng +/crosstool-ng/configure --prefix=$HOME/inst-ctng +make +make install diff --git a/testing/docker/common-scripts/su-as-user b/testing/docker/common-scripts/su-as-user new file mode 100755 index 00000000..7f262aca --- /dev/null +++ b/testing/docker/common-scripts/su-as-user @@ -0,0 +1,15 @@ +#!/bin/bash + +usr=$1 +uid=$2 +grp=$3 +gid=$4 +shift 4 + +groupadd -g ${gid} ${grp} +useradd -d /home/${usr} -m -g ${gid} -u ${uid} ${usr} +if [ -z "$*" ]; then + exec su -l ${usr} +else + exec su -l -c "/bin/bash -c '$*'" +fi |