diff options
author | Alexey Neyman <stilor@att.net> | 2018-04-18 05:47:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-18 05:47:39 (GMT) |
commit | 90d14443d1ab1d650f7aef98df3d2948ba6dd605 (patch) | |
tree | 88a932353f8dc19342b674cc57dee4bae39dd3ee /testing/docker/common-scripts | |
parent | 5472517b31bde9b1ab71fd3369f3370e813e0351 (diff) | |
parent | 345dc4161d937c302248ea34ea55a9abc4bf343d (diff) |
Merge pull request #947 from stilor/docker-testing
Docker-based testing for Linux distros
Diffstat (limited to 'testing/docker/common-scripts')
-rwxr-xr-x | testing/docker/common-scripts/ctng-install | 10 | ||||
-rwxr-xr-x | testing/docker/common-scripts/ctng-test-all | 12 | ||||
-rwxr-xr-x | testing/docker/common-scripts/su-as-user | 16 |
3 files changed, 38 insertions, 0 deletions
diff --git a/testing/docker/common-scripts/ctng-install b/testing/docker/common-scripts/ctng-install new file mode 100755 index 0000000..f29093a --- /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/ctng-test-all b/testing/docker/common-scripts/ctng-test-all new file mode 100755 index 0000000..f0ba266 --- /dev/null +++ b/testing/docker/common-scripts/ctng-test-all @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e +cd +rm -rf bld-samples +mkdir bld-samples +cd bld-samples +export PATH=$HOME/inst-ctng/bin:$PATH +ct-ng help +ct-ng list-samples +ct-ng list-steps +ct-ng build-all diff --git a/testing/docker/common-scripts/su-as-user b/testing/docker/common-scripts/su-as-user new file mode 100755 index 0000000..99246f2 --- /dev/null +++ b/testing/docker/common-scripts/su-as-user @@ -0,0 +1,16 @@ +#!/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} +ln -sf /src /home/${usr}/src +if [ -z "$*" ]; then + exec su -l ${usr} +else + exec su -l -c "/bin/bash -c '$*'" ${usr} +fi |