Skip to content

Commit 23fbd68

Browse files
committed
NS: minor changes in scripts and test
1 parent 40705b7 commit 23fbd68

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

extensions/network-namespace/network-namespace-wrapper.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,7 @@ dhcp-option=3,${GATEWAY}
13971397
dhcp-hostsfile=${dhcp_hosts}
13981398
addn-hosts=${hosts}
13991399
dhcp-optsfile=${dhcp_opts}
1400-
log-facility=/var/log/cloudstack/network-namespace-dnsmasq-${NETWORK_ID}.log
1400+
log-facility=/var/log/cloudstack/extensions/${_WRAPPER_EXT_DIR}/dnsmasq-${NETWORK_ID}.log
14011401
EOF
14021402
# Add DHCP option 15 (domain-search) when provided by the caller
14031403
if [ -n "${DOMAIN}" ]; then
@@ -1649,7 +1649,7 @@ ${unixd_line}
16491649
${authz_line}
16501650
16511651
DocumentRoot ${www}
1652-
ErrorLog /var/log/cloudstack/network-namespace-apache2-${NETWORK_ID}.log
1652+
ErrorLog /var/log/cloudstack/extensions/${_WRAPPER_EXT_DIR}/apache2-${NETWORK_ID}.log
16531653
16541654
<VirtualHost ${listen_ip}:80>
16551655
ServerName metadata
@@ -1718,7 +1718,7 @@ _svc_start_or_reload_passwd_server() {
17181718
local script_f; script_f=$(_passwd_server_script)
17191719
local pid_f; pid_f=$(_passwd_server_pid)
17201720
local passwd_f; passwd_f=$(_passwd_file)
1721-
local log_f; log_f="/var/log/cloudstack/network-namespace-passwd-${NETWORK_ID}.log"
1721+
local log_f; log_f="/var/log/cloudstack/extensions/${_WRAPPER_EXT_DIR}/passwd-${NETWORK_ID}.log"
17221722

17231723
mkdir -p "$(dirname "${script_f}")"
17241724
touch "${passwd_f}"

test/integration/smoke/test_network_extension_namespace.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,17 @@
7171

7272
_multiprocess_shared_ = True
7373

74-
# Base directory on KVM agents where wrapper scripts are installed.
75-
# The actual per-extension subdirectory is derived at runtime from the
76-
# extension name: /etc/cloudstack/extensions/<ext-name>/
77-
EXTENSIONS_BASE_DIR = '/etc/cloudstack/extensions'
74+
# The file names of the scripts to deploy on the management server and KVM hosts.
7875
SCRIPT_FILENAME = 'network-namespace-wrapper.sh'
7976
ENTRY_POINT_FILENAME = 'network-namespace.sh'
8077

81-
# State directory used by network-namespace-wrapper.sh on KVM hosts
82-
KVM_STATE_DIR = '/var/lib/cloudstack/network-namespace'
83-
8478
# Remote URLs to download the scripts from
8579
_GITHUB_BASE = (
8680
'https://raw.githubusercontent.com/apache/cloudstack-extensions'
87-
'/refs/heads/network-namespace/Network-Namespace'
81+
'/refs/heads/network-namespace/Network-Namespace/'
8882
)
89-
WRAPPER_SCRIPT_URL = _GITHUB_BASE + '/network-namespace-wrapper.sh'
90-
ENTRY_POINT_SCRIPT_URL = _GITHUB_BASE + '/network-namespace.sh'
83+
WRAPPER_SCRIPT_URL = _GITHUB_BASE + SCRIPT_FILENAME
84+
ENTRY_POINT_SCRIPT_URL = _GITHUB_BASE + ENTRY_POINT_FILENAME
9185

9286
# Local cache paths (downloaded once, reused across test methods)
9387
_THIS_DIR = os.path.dirname(os.path.abspath(__file__))

0 commit comments

Comments
 (0)