summaryrefslogtreecommitdiff
path: root/cloudinit/tests/helpers.py
diff options
context:
space:
mode:
authorRyan Harper <ryan.harper@canonical.com>2019-09-09 21:13:01 +0000
committerServer Team CI Bot <josh.powers+server-team-bot@canonical.com>2019-09-09 21:13:01 +0000
commitfa47d527a03a00319936323f0a857fbecafceaf7 (patch)
treede0814b9cd1ec166b030591761d7dee9e67480c9 /cloudinit/tests/helpers.py
parent476050b46021130654a7417bbb41647a5214dbcc (diff)
downloadvyos-cloud-init-fa47d527a03a00319936323f0a857fbecafceaf7.tar.gz
vyos-cloud-init-fa47d527a03a00319936323f0a857fbecafceaf7.zip
net,Oracle: Add support for netfailover detection
Add support for detecting netfailover[1] device 3-tuple in networking layer. In the Oracle datasource ensure that if a provided network config, either fallback or provided config includes a netfailover master to remove any MAC address value as this can break under 3-netdev as the other two devices have the same MAC. 1. https://www.kernel.org/doc/html/latest/networking/net_failover.html
Diffstat (limited to 'cloudinit/tests/helpers.py')
-rw-r--r--cloudinit/tests/helpers.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/cloudinit/tests/helpers.py b/cloudinit/tests/helpers.py
index 23fddd07..4dad2afd 100644
--- a/cloudinit/tests/helpers.py
+++ b/cloudinit/tests/helpers.py
@@ -6,7 +6,9 @@ import functools
import httpretty
import logging
import os
+import random
import shutil
+import string
import sys
import tempfile
import time
@@ -243,6 +245,12 @@ class CiTestCase(TestCase):
myds.metadata.update(metadata)
return cloud.Cloud(myds, self.paths, sys_cfg, mydist, None)
+ @classmethod
+ def random_string(cls, length=8):
+ """ return a random lowercase string with default length of 8"""
+ return ''.join(
+ random.choice(string.ascii_lowercase) for _ in range(length))
+
class ResourceUsingTestCase(CiTestCase):