Add testing for os_vm_quota_cores (#13)
This commit is contained in:
		
							
								
								
									
										3
									
								
								AUTHORS
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								AUTHORS
									
									
									
									
									
								
							| @@ -1,3 +0,0 @@ | ||||
| Kevin Carter <kcarter@linux.com> | ||||
| Kevin Carter <kevin.carter@rackspace.com> | ||||
| Major Hayden <major@mhtx.net> | ||||
							
								
								
									
										11
									
								
								ChangeLog
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								ChangeLog
									
									
									
									
									
								
							| @@ -1,11 +0,0 @@ | ||||
| CHANGES | ||||
| ======= | ||||
|  | ||||
| * Added VM instances used and quotas | ||||
| * Improve test coverage (#4) | ||||
| * Remove sys from uptime test (#3) | ||||
| * Increase test coverage for uptime | ||||
| * Added KVM Metric plugin (#2) | ||||
| * Couple of updates: telegraf line protocol, dynamic imports, metadata (#1) | ||||
| * Proof of concept | ||||
| * Initial commit | ||||
							
								
								
									
										47
									
								
								tests/files/test-openstack.ini
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								tests/files/test-openstack.ini
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,47 @@ | ||||
| # Store the authentication credentials needed to query a given OpenStack Service. | ||||
| #  All sections are overrides for the defaults. If you only need to connect to a | ||||
| #  single cloud simply store the credentials needd in the DEFAULT section and | ||||
| #  override whatever is needed within the local sections. | ||||
|  | ||||
| [DEFAULT] | ||||
| insecure = false | ||||
| auth_url = https://localhost:5000/v3 | ||||
|  | ||||
| # NOTE(cloudnull): | ||||
| #  When using keystone V3 you will need the .*domain_name configuration options. | ||||
| user_domain_name = default  # This is required when Keystone V3 is being used | ||||
| project_domain_name = default  # This is required when Keystone V3 is being used | ||||
|  | ||||
| #  If you're using keystone V2 you will need the tenant_name option. | ||||
| tenant_name = admin  # This is required when Keystone V2 is being used | ||||
|  | ||||
| # NEVER Mix and match the options tenant name and domain_name options. | ||||
| #  You are be required to run either V2 or V3 as it pertains to this config. | ||||
| #  If you provide both tenant_name and .*domain_name options at the same time | ||||
| #  the plugins will fail API version negotiation. | ||||
|  | ||||
| username = admin | ||||
| password = Secrete | ||||
| # The verify option is for SSL. If your SSL certificate is not | ||||
| #  valid set this option to false else omit it or set it true. | ||||
| verify = false | ||||
|  | ||||
| [keystone] | ||||
|  | ||||
| [glance] | ||||
|  | ||||
| [nova] | ||||
| project_name = nova | ||||
|  | ||||
| [neutron] | ||||
|  | ||||
| [heat] | ||||
|  | ||||
| [cinder] | ||||
|  | ||||
| [ironic] | ||||
| auth_url = https://localhost:5000/v3 | ||||
| project_name = ironic | ||||
| user_domain_name = users | ||||
| project_domain_name = projects | ||||
| password = SuperSecrete | ||||
| @@ -22,7 +22,12 @@ from monitorstack.cli import cli | ||||
|  | ||||
| def _runner(module): | ||||
|     runner = CliRunner() | ||||
|     result = runner.invoke(cli, ['-f', 'json', module]) | ||||
|     result = runner.invoke(cli, [ | ||||
|         '-f', 'json', | ||||
|         module, | ||||
|         '--config-file', 'tests/files/test-openstack.ini', | ||||
|     ]) | ||||
|     print(result) | ||||
|     return json.loads(result.output) | ||||
|  | ||||
|  | ||||
| @@ -31,11 +36,9 @@ class TestOs(object): | ||||
|  | ||||
|     def test_os_vm_quota_cores(self): | ||||
|         """Ensure the run() method works.""" | ||||
|  | ||||
|         # result_json = _runner(module='os_vm_quota_cores') | ||||
|         # variables = result_json['variables'] | ||||
|         # meta = result_json['meta'] | ||||
|         pass | ||||
|         result = _runner('os_vm_quota_cores') | ||||
|         assert result['measurement_name'] == 'os_vm_quota_cores' | ||||
|         assert result['meta'] == {'quotas': 'cores'} | ||||
|  | ||||
|     def test_os_vm_quota_instances(self): | ||||
|         """Ensure the run() method works.""" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Major Hayden
					Major Hayden