2013/1/22 Helga Velroyen <hel...@google.com>:
> --- a/qa/qa-sample.json
> +++ b/qa/qa-sample.json
> +  "networks": {
> +    "inexistent-networks": [
> +      "network1",
> +      "network2",
> +      "network3",

The comma here makes the file invalid JSON.

> +    ]
> +  }
> +
>    "tests": {
>      "# Whether tests are enabled or disabled by default": null,
>      "default": true,
> @@ -171,7 +179,9 @@
>      "# Make sure not to include the disk(s) required for Dom0 to be up": 
> null,
>      "# in the volume group used for instances. Otherwise the whole": null,
>      "# system may stop working until restarted.": null,
> -    "instance-disk-failure": false
> +    "instance-disk-failure": false,
> +
> +    "network": false

Please move this further up, e.g. between “group*” and “node*”. The
tests at the end are a bit “special”.

>    },
>
>    "options": {
> diff --git a/qa/qa_network.py b/qa/qa_network.py
> new file mode 100644
> index 0000000..6eeb099
> --- /dev/null
> +++ b/qa/qa_network.py
> +def GetNonexistentNetworks(count):
> +  """Gets network names which shouldn't exist on the cluster.
> +
> +  @param count: Number of networks to get
> +  @rtype: list
> +
> +  """
> +  networks = qa_config.get("networks", {})
> +
> +  default = ["network1", "network2", "network3"]
> +  assert count <= len(default)
> +
> +  candidates = networks.get("inexistent-networks", default)[:count]
> +
> +  if len(candidates) < count:
> +    raise Exception("At least %s non-existent networks are needed" % count)
> +
> +  return candidates

Duplicated logic from GetNonexistentGroups. Please merge.

> +def TestNetworkAddRemove():
> +  AssertCommand(["gnt-network", "add", "--network", "192.168.0.1/30", 
> network1])

Use addresses from RFC 5737, elsewhere too.

Michael

Reply via email to