]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/qemu: support arbitrary additions to cloud-init-archive
authorJason Dillaman <dillaman@redhat.com>
Tue, 20 Dec 2016 00:45:12 +0000 (19:45 -0500)
committerJason Dillaman <dillaman@redhat.com>
Thu, 26 Jan 2017 19:16:10 +0000 (14:16 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
qa/tasks/qemu.py

index 11b5920f64f5ba24c6f47b8b471fe80e2362dd1c..5cd7d883cdd401e75bcc45e05819e216b7f54056 100644 (file)
@@ -6,6 +6,7 @@ from cStringIO import StringIO
 import contextlib
 import logging
 import os
+import yaml
 
 from teuthology import misc as teuthology
 from teuthology import contextutil
@@ -136,6 +137,11 @@ def generate_iso(ctx, config):
   mount -t xfs /dev/vd{dev_letter} /mnt/test_{dev_letter}
 """.format(dev_letter=dev_letter)
 
+        cloud_config_archive = client_config.get('cloud_config_archive', [])
+        if cloud_config_archive:
+          user_data += yaml.safe_dump(cloud_config_archive, default_style='|',
+                                      default_flow_style=False)
+
         # this may change later to pass the directories as args to the
         # script or something. xfstests needs that.
         user_data += """
@@ -458,6 +464,23 @@ def task(ctx, config):
             client.0:
               test: http://download.ceph.com/qa/test.sh
               clone: true
+
+    If you need to configure additional cloud-config options, set cloud_config
+    to the required data set::
+
+        tasks:
+        - ceph
+        - qemu:
+            client.0:
+                test: http://ceph.com/qa/test.sh
+                cloud_config_archive:
+                    - |
+                      #/bin/bash
+                      touch foo1
+                    - content: |
+                        test data
+                      type: text/plain
+                      filename: /tmp/data
     """
     assert isinstance(config, dict), \
            "task qemu only supports a dictionary for configuration"