From 5256e26f685066c07d12bf97bdb2d6bf1b7d6ad8 Mon Sep 17 00:00:00 2001 From: Tim Pepper Date: Mon, 20 Nov 2017 15:10:40 -0800 Subject: [PATCH] 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 --- test/e2e_node/environment/setup_host.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e_node/environment/setup_host.sh b/test/e2e_node/environment/setup_host.sh index 7b588435540..5c39895d6a9 100755 --- a/test/e2e_node/environment/setup_host.sh +++ b/test/e2e_node/environment/setup_host.sh @@ -57,8 +57,8 @@ cat /etc/*-release | grep "ID=ubuntu" if [ $? -eq 0 ]; then if ! which nsenter > /dev/null; then echo "Do not find nsenter. Install it." - mkdir -p /tmp/nsenter-install - cd /tmp/nsenter-install + NSENTER_BUILD_DIR=$(mktemp -d /tmp/nsenter-build-XXXXXX) + cd $NSENTER_BUILD_DIR 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 --yes install make @@ -67,7 +67,7 @@ if [ $? -eq 0 ]; then ./configure --without-ncurses make nsenter sudo cp nsenter /usr/local/bin - rm -rf /tmp/nsenter-install + rm -rf $NSENTER_BUILD_DIR fi fi