starcluster.tests.templates.config

Package starcluster :: Package tests :: Package templates :: Module config |
[hide private]
[frames] | no frames]

# Source Code for Module starcluster.tests.templates.config

      1  #!/usr/bin/env python
      2
      3  default_config = {
      4      'default': 'smallcluster',
      5      'enable_experimental': 'False',
      6      'aws_access_key_id': 'asd0asd9f0asd0fas0d9f0',
      7      'aws_secret_access_key': 'asdf0a9sdf09203fj0asdf',
      8      'aws_user_id': 9009230923,
      9      'k1_location': '~/.path/to/k1_rsa',
     10      'k2_location': '/path/to/k2_rsa',
     11      'k3_location': '/path/to/k3_rsa',
     12      'v1_id': 'vol-c999999',
     13      'v1_device': '/dev/sdj',
     14      'v1_partition': 1,
     15      'v1_mount_path': '/volume1',
     16      'v2_id': 'vol-c888888',
     17      'v2_device': '/dev/sdk',
     18      'v2_partition': 1,
     19      'v2_mount_path': '/volume2',
     20      'v3_id': 'vol-c777777',
     21      'v3_device': '/dev/sdl',
     22      'v3_partition': 1,
     23      'v3_mount_path': '/volume3',
     24      'p1_class': 'starcluster.tests.mytestplugin.SetupClass',
     25      'p1_param1': 23,
     26      'p1_param2': 'skidoo',
     27      'p2_class': 'starcluster.tests.mytestplugin.SetupClass2',
     28      'p2_param1': 'hello',
     29      'p2_param2': 'world',
     30      'p3_class': 'starcluster.tests.mytestplugin.SetupClass3',
     31      'p3_param1': 'bon',
     32      'p3_param2': 'jour',
     33      'p3_param3': 'monsignour',
     34      's1_protocol': 'udp',
     35      's1_from_port': 20,
     36      's1_to_port': 20,
     37      's1_cidr_ip': '192.168.1.0/24',
     38      's2_protocol': 'tcp',
     39      's2_from_port': 80,
     40      's2_to_port': 20,
     41      's2_cidr_ip': '192.168.233.0/24',
     42      's3_from_port': 20,
     43      's3_to_port': 30,
     44      'c1_keyname': 'k1',
     45      'c1_size': 4,
     46      'c1_user': 'testuser',
     47      'c1_shell': 'zsh',
     48      'c1_master_id': 'ami-8f9e71e6',
     49      'c1_node_id': 'ami-8f9e71e6',
     50      'c1_master_type': 'm1.small',
     51      'c1_node_type': 'm1.small',
     52      'c1_vols': 'v1,v2,v3',
     53      'c1_plugs': 'p1,p2,p3',
     54      'c1_zone': 'us-east-1c',
     55      'c2_extends': 'c1',
     56      'c2_keyname': 'k2',
     57      'c2_size': 6,
     58      'c2_master_type': 'c1.xlarge',
     59      'c2_node_type': 'c1.xlarge',
     60      'c2_vols': 'v1,v2',
     61      'c3_extends': 'c2',
     62      'c3_keyname': 'k3',
     63      'c3_size': 8,
     64      'c3_vols': 'v3',
     65      'c4_extends': 'c3',
     66      'c4_permissions': 's1',
     67  }
     68
     69  config_test_template = """
     70  [global]
     71  DEFAULT=%(default)s
     72  ENABLE_EXPERIMENTAL=%(enable_experimental)s
     73
     74  [aws info]
     75  AWS_ACCESS_KEY_ID = %(aws_access_key_id)s
     76  AWS_SECRET_ACCESS_KEY = %(aws_secret_access_key)s
     77  AWS_USER_ID= %(aws_user_id)s
     78
     79  [key k1]
     80  KEY_LOCATION=%(k1_location)s
     81
     82  [key k2]
     83  KEY_LOCATION=%(k2_location)s
     84
     85  [key k3]
     86  KEY_LOCATION=%(k3_location)s
     87
     88  [volume v1]
     89  VOLUME_ID = %(v1_id)s
     90  DEVICE = %(v1_device)s
     91  PARTITION = %(v1_partition)s
     92  MOUNT_PATH = %(v1_mount_path)s
     93
     94  [volume v2]
     95  VOLUME_ID = %(v2_id)s
     96  DEVICE = %(v2_device)s
     97  PARTITION = %(v2_partition)s
     98  MOUNT_PATH = %(v2_mount_path)s
     99
    100  [volume v3]
    101  VOLUME_ID = %(v3_id)s
    102  DEVICE = %(v3_device)s
    103  PARTITION = %(v3_partition)s
    104  MOUNT_PATH = %(v3_mount_path)s
    105
    106  [plugin p1]
    107  SETUP_CLASS = %(p1_class)s
    108  MY_ARG = %(p1_param1)s
    109  MY_OTHER_ARG = %(p1_param2)s
    110
    111  [plugin p2]
    112  SETUP_CLASS = %(p2_class)s
    113  MY_ARG = %(p2_param1)s
    114  MY_OTHER_ARG = %(p2_param2)s
    115
    116  [plugin p3]
    117  SETUP_CLASS = %(p3_class)s
    118  MY_ARG = %(p3_param1)s
    119  MY_OTHER_ARG = %(p3_param2)s
    120  MY_OTHER_OTHER_ARG = %(p3_param3)s
    121
    122  [permission s1]
    123  protocol = %(s1_protocol)s
    124  from_port = %(s1_from_port)s
    125  to_port = %(s1_to_port)s
    126  cidr_ip = %(s1_cidr_ip)s
    127
    128  [permission s2]
    129  protocol = %(s2_protocol)s
    130  from_port = %(s2_from_port)s
    131  to_port = %(s2_to_port)s
    132  cidr_ip = %(s2_cidr_ip)s
    133
    134  [permission s3]
    135  from_port = %(s3_from_port)s
    136  to_port = %(s3_to_port)s
    137
    138  [cluster c1]
    139  KEYNAME = %(c1_keyname)s
    140  CLUSTER_SIZE = %(c1_size)s
    141  CLUSTER_USER = %(c1_user)s
    142  CLUSTER_SHELL = %(c1_shell)s
    143  MASTER_IMAGE_ID = %(c1_master_id)s
    144  MASTER_INSTANCE_TYPE = %(c1_master_type)s
    145  NODE_IMAGE_ID = %(c1_node_id)s
    146  NODE_INSTANCE_TYPE = %(c1_node_type)s
    147  AVAILABILITY_ZONE = %(c1_zone)s
    148  VOLUMES = %(c1_vols)s
    149  PLUGINS = %(c1_plugs)s
    150
    151  [cluster c2]
    152  EXTENDS=%(c2_extends)s
    153  KEYNAME = %(c2_keyname)s
    154  CLUSTER_SIZE= %(c2_size)s
    155  MASTER_INSTANCE_TYPE = %(c2_master_type)s
    156  NODE_INSTANCE_TYPE = %(c2_node_type)s
    157  VOLUMES = %(c2_vols)s
    158
    159  [cluster c3]
    160  EXTENDS=%(c3_extends)s
    161  KEYNAME = %(c3_keyname)s
    162  CLUSTER_SIZE= %(c3_size)s
    163  VOLUMES = %(c3_vols)s
    164
    165  [cluster c4]
    166  EXTENDS=%(c4_extends)s
    167  PERMISSIONS=%(c4_permissions)s
    168  """
    169