示例#1
0
def test_util():
  assert get_arch('m1.large') == 'pvm'
  assert get_arch('m3.large') == 'hvm'

  assert get_ami('m3.large', 'us-east-1') == 'ami-6d1c2007'
  assert get_ami('m1.large', 'us-east-1') == None

  hosts_dir = '../../conf/hosts'
  assert parse_args(hosts_dir, ['launch']) == None
  assert parse_args(hosts_dir, ['launch', 'mycluster']) == None
  assert parse_args(hosts_dir, ['-c', 'mycluster', 'launch']) != None

  hosts_dir = '../../conf/hosts/example'
  assert parse_args(hosts_dir, ['setup']) != None
  assert parse_args(hosts_dir, ['config']) == None
  assert parse_args(hosts_dir, ['-p', 'all', 'config']) != None
示例#2
0
 def verify_instance_type(self, instance_type):
     if not self.cluster_template_d:
         if get_arch(instance_type) == 'pvm':
             exit(
                 "ERROR - Configuration contains instance type '{0}' that uses pvm architecture."
                 "Only hvm architecture is supported!".format(
                     instance_type))
示例#3
0
def test_util():
    assert set(get_ephemeral_devices('m3.large')) == set(['/dev/xvdb'])
    assert set(get_ephemeral_devices('m3.xlarge')) == set(['/dev/xvdb', '/dev/xvdc'])

    assert set(get_ephemeral_devices('i3.xlarge')) == set(['/dev/nvme0n1'])
    assert set(get_ephemeral_devices('i3.4xlarge')) == set(['/dev/nvme0n1','/dev/nvme1n1'])

    assert get_arch('m1.large') == 'pvm'
    assert get_arch('m3.large') == 'hvm'

    hosts_dir = '../conf/hosts'
    assert parse_args(hosts_dir, ['launch']) is None
    assert parse_args(hosts_dir, ['launch', 'mycluster']) is None
    assert parse_args(hosts_dir, ['-c', 'mycluster', 'launch']) is not None

    hosts_dir = '../conf/hosts/example'
    assert parse_args(hosts_dir, ['setup']) is not None
    assert parse_args(hosts_dir, ['config']) is None
    assert parse_args(hosts_dir, ['-p', 'all', 'config']) is not None
示例#4
0
def test_util():
    assert set(get_ephemeral_devices("m3.large")) == set(["/dev/xvdb"])
    assert set(get_ephemeral_devices("m3.xlarge")) == set(
        ["/dev/xvdb", "/dev/xvdc"]
    )

    assert set(get_ephemeral_devices("i3.xlarge")) == set(["/dev/nvme0n1"])
    assert set(get_ephemeral_devices("i3.4xlarge")) == set(
        ["/dev/nvme0n1", "/dev/nvme1n1"]
    )

    assert get_arch("m1.large") == "pvm"
    assert get_arch("m3.large") == "hvm"

    hosts_dir = "../conf/hosts"
    assert parse_args(hosts_dir, ["launch"]) is None
    assert parse_args(hosts_dir, ["launch", "mycluster"]) is None
    assert parse_args(hosts_dir, ["-c", "mycluster", "launch"]) is not None

    hosts_dir = "../conf/hosts/example"
    assert parse_args(hosts_dir, ["setup"]) is not None
    assert parse_args(hosts_dir, ["config"]) is None
    assert parse_args(hosts_dir, ["-p", "all", "config"]) is not None