From nobody Tue Oct 08 07:07:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN6Y25Xz0z5Z54F; Tue, 08 Oct 2024 07:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN6Y255Xgz42kf; Tue, 8 Oct 2024 07:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMW4yyv7XJ0nybJihjIhujKZd4S200beIBJxqD1QJNg=; b=wQYkOTjBE42RWb4mV9kvocoH/5N5S3x/SnrItTJpQruJR/rBOgiTgO42gPHiHZkeVqUb3S 4zn5zQdCsftkGsSW1pfML+59PVeeAn9TKBN4uC7GBckrQYqdS4q66wkUszKDMnYNrSnoJ8 aPTZ/QNgu+18Gq/7I2cFMG5z7Pr4LyaolrANjyql6lwR7VYpKAxA7EXOv5B9lSVuqwxFDp 3G1r77lL98I772CGUSBsCDC+Xe436LUVstbNK7E+uTZTtAf8MM4CNHDx4+mQomZyY6mLRb c+8sIT4VGk5oE8wfw+qya1qEGmxdY5eY0MGzJsVmgduvW4XcBXOmRsz1ohoOrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMW4yyv7XJ0nybJihjIhujKZd4S200beIBJxqD1QJNg=; b=S8xN6S3qh8I0C0JNhXW+o4CDdJwJIiyTIaEWFUjdgMsbfOyMn0TYYlfrxY98cEwr8qLOLZ 38/9N8fYF8TEPkr9+GNLvXBWeZjBvW16y3+jPvdJaEDtMT2dvi56a2cg3ImVVAOVkaBKaf 71mgkgf7j8TXNgT/vVdEDV4yMjf9FBZC5iV1Rwho+st65vU/h8Gj032xjcok+hySoYbnY0 6UPBqPB/laGFjoxbAnUsXENLb32xzk4isU3QRA3enbRbanSTzrizXw6FIrCxHdeWu/8hqo SVe+1uWtsES0jRMMs4wzxiE1h14eqZBNQMNDX50/L+5j3Vdfxc9/m+K/OF9Jiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728371270; a=rsa-sha256; cv=none; b=MXzoSmJJFNJjdEgLxyxSLVC+J3A2D1HZYIQfVyS1YahhC95fI0zw7TXSZktf8tojemjbU8 hYPZIPX3jAWLnYavQquhn+ZngNE5QWOnRVMtHTfc2vZs2j2YVo4jupiM9lFZXuyKRaHlUB yDeqgp1zVXEFneUDN3u7ui/RxD3LQRz7IIQheu5UKCpeDDaPzCo1C5qVclywEXrJc7qfZm lIyIsWi4KO+HvDu2vDbYDr4Tq753Q+oOppUHNkrAfxh/0S6L7t1us5uWEWREwope8WVx8E /nvZQyb4kMYJTdMZew/X5WhVtRh3NPLd/gWXr8YaHHf0ERJ7h8rTZzeMXbDVyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN6Y24NbnzLTj; Tue, 8 Oct 2024 07:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49877oQJ051645; Tue, 8 Oct 2024 07:07:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49877o0g051642; Tue, 8 Oct 2024 07:07:50 GMT (envelope-from git) Date: Tue, 8 Oct 2024 07:07:50 GMT Message-Id: <202410080707.49877o0g051642@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: e573007af24a - stable/14 - nuageinit: tests: Cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e573007af24ac41dbd3f8f959949f30b6047587e Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=e573007af24ac41dbd3f8f959949f30b6047587e commit e573007af24ac41dbd3f8f959949f30b6047587e Author: Jose Luis Duran AuthorDate: 2024-07-30 03:26:21 +0000 Commit: Baptiste Daroussin CommitDate: 2024-10-08 07:04:02 +0000 nuageinit: tests: Cleanup - Export NUAGE_FAKE_ROOTDIR only once - Use the header section of the test to require the root user - Use the PWD environment variable - Set the root/sys shell as /bin/sh - Use RFC 5737 reserved IP addresses Signed-off-by: Jose Luis Duran (cherry picked from commit e72457c4f5166eef2a27249e02f3c1e9a1cf852d) --- libexec/nuageinit/tests/nuage.sh | 14 +-- libexec/nuageinit/tests/nuageinit.sh | 165 ++++++++++++++++------------------- 2 files changed, 83 insertions(+), 96 deletions(-) diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh index 6d8a2746de1f..293a0a4a9a83 100644 --- a/libexec/nuageinit/tests/nuage.sh +++ b/libexec/nuageinit/tests/nuage.sh @@ -4,6 +4,8 @@ # SPDX-License-Identifier: BSD-2-Clause # +export NUAGE_FAKE_ROOTDIR="$PWD" + atf_test_case sethostname atf_test_case addsshkey atf_test_case adduser @@ -11,7 +13,6 @@ atf_test_case addgroup sethostname_body() { - export NUAGE_FAKE_ROOTDIR="$(pwd)" atf_check /usr/libexec/flua $(atf_get_srcdir)/sethostname.lua if [ ! -f etc/rc.conf.d/hostname ]; then atf_fail "hostname not written" @@ -32,14 +33,14 @@ addsshkey_body() atf_check -o inline:"mykey\nmykey\n" cat .ssh/authorized_keys } +adduser_head() +{ + atf_set "require.user" root +} adduser_body() { - export NUAGE_FAKE_ROOTDIR="$(pwd)" - if [ $(id -u) -ne 0 ]; then - atf_skip "root required" - fi mkdir etc - printf "root:*:0:0::0:0:Charlie &:/root:/bin/csh\n" > etc/master.passwd + printf "root:*:0:0::0:0:Charlie &:/root:/bin/sh\n" > etc/master.passwd pwd_mkdb -d etc etc/master.passwd printf "wheel:*:0:root\n" > etc/group atf_check -e inline:"nuageinit: Argument should be a table\nnuageinit: Argument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/adduser.lua @@ -49,7 +50,6 @@ adduser_body() addgroup_body() { - export NUAGE_FAKE_ROOTDIR="$(pwd)" mkdir etc printf "wheel:*:0:root\n" > etc/group atf_check -e inline:"nuageinit: Argument should be a table\nnuageinit: Argument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/addgroup.lua diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 434fb3095929..f7f39ce32ad8 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -4,6 +4,8 @@ # SPDX-License-Identifier: BSD-2-Clause # +export NUAGE_FAKE_ROOTDIR="$PWD" + atf_test_case args atf_test_case nocloud atf_test_case nocloud_userdata_script @@ -27,56 +29,51 @@ args_body() nocloud_body() { - here=$(pwd) mkdir -p media/nuageinit - atf_check -s exit:1 -e match:"nuageinit: error parsing nocloud.*" /usr/libexec/nuageinit ${here}/media/nuageinit/ nocloud - export NUAGE_FAKE_ROOTDIR=$(pwd) - printf "instance-id: iid-local01\nlocal-hostname: cloudimg\n" > ${here}/media/nuageinit/meta-data - atf_check -s exit:0 /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + atf_check -s exit:1 -e match:"nuageinit: error parsing nocloud.*" /usr/libexec/nuageinit "${PWD}"/media/nuageinit/ nocloud + printf "instance-id: iid-local01\nlocal-hostname: cloudimg\n" > "${PWD}"/media/nuageinit/meta-data + atf_check -s exit:0 /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud atf_check -o inline:"hostname=\"cloudimg\"\n" cat etc/rc.conf.d/hostname cat > media/nuageinit/meta-data << EOF instance-id: iid-local01 hostname: myhost EOF - atf_check -s exit:0 /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + atf_check -s exit:0 /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud atf_check -o inline:"hostname=\"myhost\"\n" cat etc/rc.conf.d/hostname } nocloud_userdata_script_body() { - here=$(pwd) mkdir -p media/nuageinit - printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data - printf "#!/bin/sh\necho yeah\n" > ${here}/media/nuageinit/user-data - chmod 755 ${here}/media/nuageinit/user-data - atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data + printf "#!/bin/sh\necho yeah\n" > "${PWD}"/media/nuageinit/user-data + chmod 755 "${PWD}"/media/nuageinit/user-data + atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud } nocloud_user_data_script_body() { - here=$(pwd) mkdir -p media/nuageinit - printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data - printf "#!/bin/sh\necho yeah\n" > ${here}/media/nuageinit/user_data - chmod 755 ${here}/media/nuageinit/user_data - atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data + printf "#!/bin/sh\necho yeah\n" > "${PWD}"/media/nuageinit/user_data + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud } +nocloud_userdata_cloudconfig_users_head() +{ + atf_set "require.user" root +} nocloud_userdata_cloudconfig_users_body() { - here=$(pwd) - export NUAGE_FAKE_ROOTDIR=$(pwd) - if [ $(id -u) -ne 0 ]; then - atf_skip "root required" - fi mkdir -p media/nuageinit - printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data + printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data mkdir -p etc cat > etc/master.passwd << EOF -root:*:0:0::0:0:Charlie &:/root:/bin/csh -sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +root:*:0:0::0:0:Charlie &:/root:/bin/sh +sys:*:1:0::0:0:Sys:/home/sys:/bin/sh EOF - pwd_mkdb -d etc ${here}/etc/master.passwd + pwd_mkdb -d etc "${PWD}"/etc/master.passwd cat > etc/group << EOF wheel:*:0:root users:*:1: @@ -94,7 +91,7 @@ users: groups: users passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/ EOF - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud cat > expectedgroup << EOF wheel:*:0:root,freebsd users:*:1:foobar @@ -104,33 +101,33 @@ freebsd:*:1003: foobar:*:1004: EOF cat > expectedpasswd << 'EOF' -root:*:0:0::0:0:Charlie &:/root:/bin/csh -sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +root:*:0:0::0:0:Charlie &:/root:/bin/sh +sys:*:1:0::0:0:Sys:/home/sys:/bin/sh freebsd:freebsd:1001:1003::0:0:FreeBSD User:/home/freebsd:/bin/sh foobar:$6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1002:1004::0:0:Foo B. Bar:/home/foobar:/bin/sh EOF - sed -i "" "s/freebsd:.*:1001/freebsd:freebsd:1001/" ${here}/etc/master.passwd - atf_check -o file:expectedpasswd cat ${here}/etc/master.passwd - atf_check -o file:expectedgroup cat ${here}/etc/group + sed -i "" "s/freebsd:.*:1001/freebsd:freebsd:1001/" "${PWD}"/etc/master.passwd + atf_check -o file:expectedpasswd cat "${PWD}"/etc/master.passwd + atf_check -o file:expectedgroup cat "${PWD}"/etc/group } +nocloud_network_head() +{ + atf_set "require.user" root +} nocloud_network_body() { - here=$(pwd) mkdir -p media/nuageinit mkdir -p etc cat > etc/master.passwd << EOF -root:*:0:0::0:0:Charlie &:/root:/bin/csh -sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +root:*:0:0::0:0:Charlie &:/root:/bin/sh +sys:*:1:0::0:0:Sys:/home/sys:/bin/sh EOF - pwd_mkdb -d etc ${here}/etc/master.passwd + pwd_mkdb -d etc "${PWD}"/etc/master.passwd cat > etc/group << EOF wheel:*:0:root users:*:1: EOF - if [ $(id -u) -ne 0 ]; then - atf_skip "root required" - fi mynetworks=$(ifconfig -l ether) if [ -z "$mynetworks" ]; then atf_skip "a network interface is needed" @@ -138,7 +135,7 @@ EOF set -- $mynetworks myiface=$1 myaddr=$(ifconfig $myiface ether | awk '/ether/ { print $2 }') - printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data + printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data cat > media/nuageinit/user-data << EOF #cloud-config network: @@ -149,51 +146,48 @@ network: match: macaddress: "$myaddr" addresses: - - 192.168.14.2/24 - - 2001:1::1/64 - gateway4: 192.168.14.1 - gateway6: 2001:1::2 + - 192.0.2.2/24 + - 2001:db8::2/64 + gateway4: 192.0.2.1 + gateway6: 2001:db8::1 EOF - export NUAGE_FAKE_ROOTDIR=$(pwd) - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud cat > network << EOF -ifconfig_${myiface}="inet 192.168.14.2/24" -ifconfig_${myiface}_ipv6="inet6 2001:1::1/64" +ifconfig_${myiface}="inet 192.0.2.2/24" +ifconfig_${myiface}_ipv6="inet6 2001:db8::2/64" ipv6_network_interfaces="${myiface}" ipv6_default_interface="${myiface}" EOF cat > routing << EOF -defaultrouter="192.168.14.1" -ipv6_defaultrouter="2001:1::2" -ipv6_route_${myiface}="2001:1::2 -prefixlen 128 -interface ${myiface}" +defaultrouter="192.0.2.1" +ipv6_defaultrouter="2001:db8::1" +ipv6_route_${myiface}="2001:db8::1 -prefixlen 128 -interface ${myiface}" EOF - atf_check -o file:network cat ${here}/etc/rc.conf.d/network - atf_check -o file:routing cat ${here}/etc/rc.conf.d/routing + atf_check -o file:network cat "${PWD}"/etc/rc.conf.d/network + atf_check -o file:routing cat "${PWD}"/etc/rc.conf.d/routing } + config2_body() { - here=$(pwd) mkdir -p media/nuageinit - atf_check -s exit:1 -e match:"nuageinit: error parsing config-2 meta_data.json:.*" /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check -s exit:1 -e match:"nuageinit: error parsing config-2 meta_data.json:.*" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 printf "{}" > media/nuageinit/meta_data.json - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 cat > media/nuageinit/meta_data.json << EOF { "hostname": "cloudimg" } EOF - export NUAGE_FAKE_ROOTDIR=$(pwd) - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 atf_check -o inline:"hostname=\"cloudimg\"\n" cat etc/rc.conf.d/hostname } +config2_pubkeys_head() +{ + atf_set "require.user" root +} config2_pubkeys_body() { - here=$(pwd) - export NUAGE_FAKE_ROOTDIR=$(pwd) - if [ $(id -u) -ne 0 ]; then - atf_skip "root required" - fi mkdir -p media/nuageinit touch media/nuageinit/meta_data.json cat > media/nuageinit/user-data << EOF @@ -203,26 +197,24 @@ ssh_authorized_keys: EOF mkdir -p etc cat > etc/master.passwd << EOF -root:*:0:0::0:0:Charlie &:/root:/bin/csh -sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +root:*:0:0::0:0:Charlie &:/root:/bin/sh +sys:*:1:0::0:0:Sys:/home/sys:/bin/sh EOF - pwd_mkdb -d etc ${here}/etc/master.passwd + pwd_mkdb -d etc "${PWD}"/etc/master.passwd cat > etc/group << EOF wheel:*:0:root users:*:1: EOF - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 atf_check -o inline:"ssh-rsa AAAAB3NzaC1y...== Generated by Nova\n" cat home/freebsd/.ssh/authorized_keys } - +config2_pubkeys_user_data_head() +{ + atf_set "require.user" root +} config2_pubkeys_user_data_body() { - here=$(pwd) - export NUAGE_FAKE_ROOTDIR=$(pwd) - if [ $(id -u) -ne 0 ]; then - atf_skip "root required" - fi mkdir -p media/nuageinit touch media/nuageinit/meta_data.json cat > media/nuageinit/user_data << EOF @@ -232,15 +224,15 @@ ssh_authorized_keys: EOF mkdir -p etc cat > etc/master.passwd << EOF -root:*:0:0::0:0:Charlie &:/root:/bin/csh -sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +root:*:0:0::0:0:Charlie &:/root:/bin/sh +sys:*:1:0::0:0:Sys:/home/sys:/bin/sh EOF - pwd_mkdb -d etc ${here}/etc/master.passwd + pwd_mkdb -d etc "${PWD}"/etc/master.passwd cat > etc/group << EOF wheel:*:0:root users:*:1: EOF - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 atf_check -o inline:"ssh-rsa AAAAB3NzaC1y...== Generated by Nova\n" cat home/freebsd/.ssh/authorized_keys } @@ -292,7 +284,6 @@ EOF config2_network_body() { - here=$(pwd) mkdir -p media/nuageinit printf "{}" > media/nuageinit/meta_data.json mynetworks=$(ifconfig -l ether) @@ -322,7 +313,7 @@ cat > media/nuageinit/network_data.json << EOF "type": "ipv6", "link": "iface0", // supports condensed IPv6 with CIDR netmask - "ip_address": "2001:cdba::3257:9652/24", + "ip_address": "2001:db8::3257:9652/64", "gateway": "fd00::1", "routes": [ { @@ -341,11 +332,10 @@ cat > media/nuageinit/network_data.json << EOF ] } EOF - export NUAGE_FAKE_ROOTDIR=$(pwd) - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 cat > network << EOF ifconfig_${myiface}="DHCP" -ifconfig_${myiface}_ipv6="inet6 2001:cdba::3257:9652/24" +ifconfig_${myiface}_ipv6="inet6 2001:db8::3257:9652/64" ipv6_network_interfaces="${myiface}" ipv6_default_interface="${myiface}" EOF @@ -354,13 +344,12 @@ ipv6_defaultrouter="fd00::1" ipv6_route_${myiface}="fd00::1 -prefixlen 128 -interface ${myiface}" ipv6_static_routes="${myiface}" EOF - atf_check -o file:network cat ${here}/etc/rc.conf.d/network - atf_check -o file:routing cat ${here}/etc/rc.conf.d/routing + atf_check -o file:network cat "${PWD}"/etc/rc.conf.d/network + atf_check -o file:routing cat "${PWD}"/etc/rc.conf.d/routing } config2_network_static_v4_body() { - here=$(pwd) mkdir -p media/nuageinit printf "{}" > media/nuageinit/meta_data.json mynetworks=$(ifconfig -l ether) @@ -402,9 +391,7 @@ cat > media/nuageinit/network_data.json << EOF ] } EOF - - export NUAGE_FAKE_ROOTDIR=$(pwd) - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 cat > network << EOF ifconfig_${myiface}="inet 10.184.0.244 netmask 255.255.240.0" EOF @@ -413,8 +400,8 @@ route_cloudinit1_${myiface}="-net 10.0.0.0 11.0.0.1 255.0.0.0" defaultrouter="23.253.157.1" static_routes="cloudinit1_${myiface}" EOF - atf_check -o file:network cat ${here}/etc/rc.conf.d/network - atf_check -o file:routing cat ${here}/etc/rc.conf.d/routing + atf_check -o file:network cat "${PWD}"/etc/rc.conf.d/network + atf_check -o file:routing cat "${PWD}"/etc/rc.conf.d/routing } atf_init_test_cases()