diff --git a/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py b/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py index d6930803932..fff9074ffc7 100755 --- a/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py +++ b/systemvm/debian/opt/cloud/bin/cs/CsRedundant.py @@ -481,7 +481,6 @@ class CsRedundant(object): if dev == '': return CsHelper.service("radvd", "enable") - CsHelper.execute("echo \"radvd\" >> /var/cache/cloud/enabled_svcs") CsHelper.start_if_stopped("radvd") def _disable_radvd(self, dev): @@ -492,8 +491,6 @@ class CsRedundant(object): return CsHelper.service("radvd", "stop") CsHelper.service("radvd", "disable") - CsHelper.execute("sed -i \"s,radvd,,g\" /var/cache/cloud/enabled_svcs") - CsHelper.execute("sed -i '/^$/d' /var/cache/cloud/enabled_svcs") logging.info(CsHelper.execute("systemctl status radvd")) diff --git a/systemvm/debian/opt/cloud/bin/setup/common.sh b/systemvm/debian/opt/cloud/bin/setup/common.sh index a799a88be8a..18a78311aee 100755 --- a/systemvm/debian/opt/cloud/bin/setup/common.sh +++ b/systemvm/debian/opt/cloud/bin/setup/common.sh @@ -75,6 +75,8 @@ setup_interface() { local intf=eth${intfnum} local bootproto="static" + log_it "Setting up interface: ${intf}" + if [ "$BOOTPROTO" == "dhcp" ] then if [ "$intfnum" != "0" ] @@ -280,8 +282,9 @@ setup_ipv6() { then enableradvd=true setup_interface_ipv6 "0" $ETH0_IP6 $ETH0_IP6_PRELEN - fi - if [ -n "$ETH0_IP6" ] || [ -n "$GUEST_GW6" -a -n "$GUEST_CIDR6_SIZE" ] + rm -rf /etc/radvd.conf + setup_radvd "0" $ETH0_IP6 $ETH0_IP6_PRELEN $enableradvd + elif [ -n "$GUEST_GW6" -a -n "$GUEST_CIDR6_SIZE" ] then rm -rf /etc/radvd.conf setup_radvd "0" $GUEST_GW6 $GUEST_CIDR6_SIZE $enableradvd @@ -293,6 +296,7 @@ setup_ipv6() { } restore_ipv6() { + log_it "Restoring IPv6 configurations with ETH0_IP6=$ETH0_IP6 GUEST_GW6=$GUEST_GW6 GUEST_CIDR6_SIZE=$GUEST_CIDR6_SIZE ETH2_IP6=$ETH2_IP6" if [ -n "$ETH0_IP6" ] || [ -n "$GUEST_GW6" -a -n "$GUEST_CIDR6_SIZE" ] then enable_interface_ipv6 "0" true @@ -406,15 +410,8 @@ enable_radvd() { then log_it "Enabling radvd" systemctl enable radvd - echo "radvd" >> /var/cache/cloud/enabled_svcs - fi - systemctl -q is-active radvd - status=$? - if [ $status -ne 0 ] - then - log_it "Starting radvd" - systemctl start radvd fi + grep -q "radvd" /var/cache/cloud/enabled_svcs || echo "radvd" >> /var/cache/cloud/enabled_svcs } setup_radvd() { diff --git a/systemvm/debian/opt/cloud/bin/setup/init.sh b/systemvm/debian/opt/cloud/bin/setup/init.sh index a1ac48e46b5..8b78e5807da 100644 --- a/systemvm/debian/opt/cloud/bin/setup/init.sh +++ b/systemvm/debian/opt/cloud/bin/setup/init.sh @@ -20,6 +20,11 @@ set -x PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" CMDLINE=/var/cache/cloud/cmdline +log_it() { + echo "$(date) $@" >> /var/log/cloud.log + log_action_msg "$@" +} + hypervisor() { if [ -d /proc/xen ]; then mount -t xenfs none /proc/xen @@ -214,4 +219,4 @@ log_it "Starting guest services for $HYPERVISOR" config_guest source /opt/cloud/bin/setup/common.sh -setup_interface_sshd \ No newline at end of file +setup_interface_sshd diff --git a/test/integration/smoke/test_network_ipv6.py b/test/integration/smoke/test_network_ipv6.py index 1aff1fc1f28..5450234a3b1 100644 --- a/test/integration/smoke/test_network_ipv6.py +++ b/test/integration/smoke/test_network_ipv6.py @@ -845,7 +845,7 @@ class TestIpv6Network(cloudstackTestCase): cmd, hypervisor=self.routerDetailsMap[router.id]['hypervisor'] ) - self.assertTrue(type(result) == list and len(result) > 0, + self.assertTrue(type(result) == list, "%s on router %s returned invalid result" % (cmd, router.id)) result = '\n'.join(result) return result