e2e_node: use mktemp when building nsenter on trusty

There's a bit of a hack in place to insure nsenter is present on Ubuntu
trusty, which doesn't otherwise include it.  This downloads util-linux
to a hard coded directory in /tmp which is a bad practice.  Even though
"this is just a test case" it should properly use mktemp.

Signed-off-by: Tim Pepper <tpepper@vmware.com>
This commit is contained in:
Tim Pepper
2017-11-20 15:10:40 -08:00
parent 4956e65d59
commit 5256e26f68

View File

@@ -57,8 +57,8 @@ cat /etc/*-release | grep "ID=ubuntu"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
if ! which nsenter > /dev/null; then if ! which nsenter > /dev/null; then
echo "Do not find nsenter. Install it." echo "Do not find nsenter. Install it."
mkdir -p /tmp/nsenter-install NSENTER_BUILD_DIR=$(mktemp -d /tmp/nsenter-build-XXXXXX)
cd /tmp/nsenter-install cd $NSENTER_BUILD_DIR
curl https://www.kernel.org/pub/linux/utils/util-linux/v2.24/util-linux-2.24.tar.gz | tar -zxf- curl https://www.kernel.org/pub/linux/utils/util-linux/v2.24/util-linux-2.24.tar.gz | tar -zxf-
sudo apt-get update sudo apt-get update
sudo apt-get --yes install make sudo apt-get --yes install make
@@ -67,7 +67,7 @@ if [ $? -eq 0 ]; then
./configure --without-ncurses ./configure --without-ncurses
make nsenter make nsenter
sudo cp nsenter /usr/local/bin sudo cp nsenter /usr/local/bin
rm -rf /tmp/nsenter-install rm -rf $NSENTER_BUILD_DIR
fi fi
fi fi