From 5256e26f685066c07d12bf97bdb2d6bf1b7d6ad8 Mon Sep 17 00:00:00 2001 From: Tim Pepper Date: Mon, 20 Nov 2017 15:10:40 -0800 Subject: [PATCH 1/2] 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 7b58843554..5c39895d6a 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 From 3f4294cdf9c5ff50036558d56092af49d4fe0ed5 Mon Sep 17 00:00:00 2001 From: Tim Pepper Date: Mon, 20 Nov 2017 15:50:48 -0800 Subject: [PATCH 2/2] e2e_node: use newer util-linux The e2e_node test environment setup script is hard coded to pull down a quite old version of util-linux in order to build nsenter on trusty, which sadly is well known to not include an nsenter executable. While "just a test", it's unfortunate to be building from really old util-linux sources when newer are available. Signed-off-by: Tim Pepper --- test/e2e_node/environment/setup_host.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e_node/environment/setup_host.sh b/test/e2e_node/environment/setup_host.sh index 5c39895d6a..2069a3a494 100755 --- a/test/e2e_node/environment/setup_host.sh +++ b/test/e2e_node/environment/setup_host.sh @@ -59,11 +59,11 @@ if [ $? -eq 0 ]; then echo "Do not find nsenter. Install it." 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- + curl https://www.kernel.org/pub/linux/utils/util-linux/v2.31/util-linux-2.31.tar.gz | tar -zxf- sudo apt-get update sudo apt-get --yes install make sudo apt-get --yes install gcc - cd util-linux-2.24 + cd util-linux-2.31 ./configure --without-ncurses make nsenter sudo cp nsenter /usr/local/bin