Set samples default flavor to m1.tiny

Summary:
Samples should use m1.tiny instead of m1.nano
Samples should be parametrized and use m1.tiny instead of m1.nano as default flavor.

Change-Id: Ie820c573c0a9971a54f7ab20a7454a2f05dc88d2
Closes-Bug: #1431700
This commit is contained in:
Luz Cazares 2015-08-08 13:54:50 -05:00
parent a065516bb6
commit ce6d3bd1f0
64 changed files with 144 additions and 82 deletions

View File

@ -29,7 +29,7 @@ We assume that you have a :ref:`Rally installation <tutorial_step_0_installation
Registering an OpenStack deployment in Rally
--------------------------------------------
First, you have to provide Rally with an Openstack deployment it is going to benchmark. This should be done either through `OpenRC files <http://docs.openstack.org/user-guide/content/cli_openrc.html>`_ or through deployment `configuration files <https://github.com/openstack/rally/tree/master/samples/deployments>`_. In case you already have an *OpenRC*, it is extremely simple to register a deployment with the *deployment create* command:
First, you have to provide Rally with an OpenStack deployment it is going to benchmark. This should be done either through `OpenRC files <http://docs.openstack.org/user-guide/content/cli_openrc.html>`_ or through deployment `configuration files <https://github.com/openstack/rally/tree/master/samples/deployments>`_. In case you already have an *OpenRC*, it is extremely simple to register a deployment with the *deployment create* command:
.. code-block:: none
@ -94,7 +94,7 @@ Now that we have a working and registered deployment, we can start benchmarking
{
"args": {
"flavor": {
"name": "m1.nano"
"name": "m1.tiny"
},
"image": {
"name": "^cirros.*uec$"
@ -148,7 +148,7 @@ To start a benchmark task, run the task start command (you can also add the *-v*
test scenario NovaServers.boot_and_delete_server
args position 0
args values:
{u'args': {u'flavor': {u'name': u'm1.nano'},
{u'args': {u'flavor': {u'name': u'm1.tiny'},
u'force_delete': False,
u'image': {u'name': u'^cirros.*uec$'}},
u'context': {u'users': {u'project_domain': u'default',

View File

@ -58,7 +58,7 @@ As an example, let's edit our configuration file from :ref:`step 1 <tutorial_ste
{
"args": {
"flavor": {
"name": "m1.nano"
"name": "m1.tiny"
},
"image": {
"name": "^cirros.*uec$"
@ -136,7 +136,7 @@ Note that the HTML reports you can generate by typing **rally task report --out=
Multiple configurations of the same scenario
--------------------------------------------
Yet another thing you can do in Rally is to launch **the same benchmark scenario multiple times with different configurations**. That's why our configuration file stores a list for the key *"NovaServers.boot_and_delete_server"*: you can just append a different configuration of this benchmark scenario to this list to get it. Let's say, you want to run the **boot_and_delete_server** scenario twice: first using the *"m1.nano"* flavor and then using the *"m1.tiny"* flavor:
Yet another thing you can do in Rally is to launch **the same benchmark scenario multiple times with different configurations**. That's why our configuration file stores a list for the key *"NovaServers.boot_and_delete_server"*: you can just append a different configuration of this benchmark scenario to this list to get it. Let's say, you want to run the **boot_and_delete_server** scenario twice: first using the *"m1.tiny"* flavor and then using the *"m1.tiny"* flavor:
*multiple-configurations.json*
@ -147,7 +147,7 @@ Yet another thing you can do in Rally is to launch **the same benchmark scenario
{
"args": {
"flavor": {
"name": "m1.nano"
"name": "m1.tiny"
},
"image": {
"name": "^cirros.*uec$"
@ -160,7 +160,7 @@ Yet another thing you can do in Rally is to launch **the same benchmark scenario
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "m1.small"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -128,7 +128,7 @@ After you have registered a deployment with existing users, don't forget to remo
{
"args": {
"flavor": {
"name": "m1.nano"
"name": "m1.tiny"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,3 +1,4 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"CinderVolumes.create_and_attach_volume": [
{
@ -7,7 +8,7 @@
"name": "^cirros.*uec$"
},
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
}
},
"runner": {
@ -29,7 +30,7 @@
"max": 5
},
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,3 +1,4 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
CinderVolumes.create_and_attach_volume:
-
@ -6,7 +7,7 @@
image:
name: "^cirros.*uec$"
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
runner:
type: "constant"
times: 5
@ -21,7 +22,7 @@
min: 1
max: 5
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
runner:

View File

@ -1,3 +1,4 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"CinderVolumes.create_snapshot_and_attach_volume": [
{
@ -23,7 +24,7 @@
"name": "^cirros.*uec$"
},
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"servers_per_tenant": 2
}
@ -52,7 +53,7 @@
"name": "^cirros.*uec$"
},
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"servers_per_tenant": 2
}

View File

@ -1,3 +1,4 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
CinderVolumes.create_snapshot_and_attach_volume:
-
@ -18,7 +19,7 @@
image:
name: "^cirros.*uec$"
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
servers_per_tenant: 2
-
args:
@ -38,6 +39,6 @@
image:
name: "^cirros.*uec$"
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
servers_per_tenant: 2

View File

@ -1,3 +1,4 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"CinderVolumes.create_nested_snapshots_and_attach_volume": [
{
@ -26,7 +27,7 @@
"name": "^cirros.*uec$"
},
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"servers_per_tenant": 2
}

View File

@ -1,3 +1,4 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
CinderVolumes.create_nested_snapshots_and_attach_volume:
-
@ -20,5 +21,5 @@
image:
name: "^cirros.*uec$"
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
servers_per_tenant: 2

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"EC2Servers.boot_server": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
EC2Servers.boot_server:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
runner:

View File

@ -1,3 +1,4 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"GlanceImages.create_image_and_boot_instances": [
{
@ -6,7 +7,7 @@
"container_format": "bare",
"disk_format": "qcow2",
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"number_instances": 2
},

View File

@ -1,3 +1,4 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
GlanceImages.create_image_and_boot_instances:
-
@ -6,7 +7,7 @@
container_format: "bare"
disk_format: "qcow2"
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
number_instances: 2
runner:
type: "constant"

View File

@ -1,3 +1,4 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.boot_and_associate_floating_ip": [
{
@ -8,7 +9,7 @@
},
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.boot_and_associate_floating_ip:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
runner:

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.boot_and_live_migrate_server": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,8 +1,9 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.boot_and_live_migrate_server:
- args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
block_migration: true

View File

@ -1,3 +1,4 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.boot_and_delete_multiple_servers": [
{
@ -12,7 +13,7 @@
"name": "^cirros.*uec$"
},
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
}
},
"context": {

View File

@ -1,3 +1,4 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.boot_and_delete_multiple_servers:
-
@ -5,7 +6,7 @@
image:
name: "^cirros.*uec$"
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
count: 5
runner:
type: "constant"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaKeypair.boot_and_delete_server_with_keypair": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaKeypair.boot_and_delete_server_with_keypair:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
runner:

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaSecGroup.boot_and_delete_server_with_secgroups": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaSecGroup.boot_and_delete_server_with_secgroups:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
security_group_count: 10

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.boot_and_delete_server": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.boot_and_delete_server:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
force_delete: false

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.boot_and_list_server": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.boot_and_list_server:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
detailed: True

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.boot_and_live_migrate_server": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,8 +1,9 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.boot_and_live_migrate_server:
- args:
flavor:
name: m1.tiny
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
block_migration: false

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.boot_and_migrate_server": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,8 +1,9 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.boot_and_migrate_server:
- args:
flavor:
name: m1.tiny
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
runner:

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.boot_and_rebuild_server": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"from_image": {
"name": "^cirros.*uec$"

View File

@ -1,8 +1,9 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.boot_and_rebuild_server:
- args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
from_image:
name: "^cirros.*uec$"
to_image:

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.boot_and_bounce_server": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.boot_and_bounce_server:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
force_delete: false

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.boot_server_from_volume_and_delete": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.boot_server_from_volume_and_delete:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
volume_size: 10

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.boot_server_from_volume": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.boot_server_from_volume:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
volume_size: 10

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.boot_lock_unlock_and_delete": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.boot_lock_unlock_and_delete:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
runner:

View File

@ -1,3 +1,4 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.boot_server_attach_created_volume_and_live_migrate": [
{
@ -8,7 +9,7 @@
"name": "^cirros.*uec$"
},
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
}
},
"runner": {

View File

@ -1,8 +1,9 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.boot_server_attach_created_volume_and_live_migrate:
- args:
flavor:
name: m1.tiny
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
size: 10

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.boot_server_from_volume_and_live_migrate": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,8 +1,9 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.boot_server_from_volume_and_live_migrate:
- args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
block_migration: false

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.snapshot_server": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.snapshot_server:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
force_delete: false

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.boot_server": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.boot_server:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
runner:

View File

@ -1,3 +1,4 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.list_servers": [
{
@ -16,7 +17,7 @@
},
"servers": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,3 +1,4 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.list_servers:
-
@ -13,7 +14,7 @@
users_per_tenant: 1
servers:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
servers_per_tenant: 2

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.pause_and_unpause_server": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.pause_and_unpause_server:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
force_delete: false

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.resize_server": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.resize_server:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
to_flavor:

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.shelve_and_unshelve_server": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.shelve_and_unshelve_server:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
force_delete: false

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"NovaServers.suspend_and_resume_server": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
NovaServers.suspend_and_resume_server:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
force_delete: false

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"VMTasks.boot_runcommand_delete": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
VMTasks.boot_runcommand_delete:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
volume_args:

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
{
"VMTasks.boot_runcommand_delete": [
{
"args": {
"flavor": {
"name": "m1.tiny"
"name": "{{flavor_name}}"
},
"image": {
"name": "^cirros.*uec$"

View File

@ -1,9 +1,10 @@
{% set flavor_name = flavor_name or "m1.tiny" %}
---
VMTasks.boot_runcommand_delete:
-
args:
flavor:
name: "m1.tiny"
name: "{{flavor_name}}"
image:
name: "^cirros.*uec$"
floating_network: "public"

View File

@ -21,6 +21,7 @@ import traceback
import yaml
from rally import api
from rally.task import scenario
from rally.task import engine
from tests.unit import test
@ -49,7 +50,8 @@ class TaskSampleTestCase(test.TestCase):
with open(full_path) as task_file:
try:
task_config = yaml.safe_load(task_file.read())
task_config = yaml.safe_load(api.Task.render_template
(task_file.read()))
eng = engine.BenchmarkEngine(task_config,
mock.MagicMock())
eng.validate()
@ -77,7 +79,7 @@ class TaskSampleTestCase(test.TestCase):
full_path = os.path.join(dirname, filename)
with open(full_path) as task_file:
try:
json.load(task_file)
json.loads(api.Task.render_template(task_file.read()))
except Exception:
print(traceback.format_exc())
self.fail("Invalid JSON file: %s" % full_path)
@ -117,11 +119,11 @@ class TaskSampleTestCase(test.TestCase):
if os.path.exists(yaml_path) and os.path.exists(json_path):
with open(json_path) as json_file:
with open(yaml_path) as yaml_file:
json_config = yaml.safe_load(json_file.read())
yaml_config = yaml.safe_load(yaml_file.read())
self.assertEqual(
json_config,
yaml_config,
"Sample task configs are not equal:\n%s\n%s" %
(yaml_path, json_path))
json_config = yaml.safe_load(api.Task.render_template
(json_file.read()))
with open(yaml_path) as yaml_file:
yaml_config = yaml.safe_load(api.Task.render_template
(yaml_file.read()))
self.assertEqual(json_config, yaml_config,
"Sample task configs are not equal:"
"\n%s\n%s" % (yaml_path, json_path))