heat/heat/tests
Zane Bitter a08893dc86 Fix entropy problems with OS::Random::String
When generating a random string, once we had selected from the various
required pools, we continued by selecting a pool at random and then
selecting a character from that pool at random. This did not take into
account the differing sizes of the available pools, nor the fact that the
same character could appear in multiple pools, which resulted in a
non-uniform probability distribution of characters. Since users mostly make
use of this feature to generate default passwords for services they are
deploying, this would result in the generated passwords having slightly
less entropy than expected (and pathological cases were possible).

Rectify this by always selecting non-constrained characters from a single
combined pool, and by ensuring that each character appears only once in any
pool we're selecting from.

Since we also want to use this method to generate passwords for OpenStack
Users, the new implementation is in a separate module in heat.common rather
than mixed in with the resource's logic. Also, use a StringIO object to
collect the characters rather than repeatedly appending to a string.

Change-Id: Ia7b63e72c1e3c0649290caf4fea8a32f7f89560b
Closes-Bug: #1757300
Related-Bug: #1666129
Related-Bug: #1444429
(cherry picked from commit 6e16c051ba)
2018-04-05 12:43:13 -04:00
..
api Merge "Add unit tests for function 'index'" 2017-07-19 14:08:25 +00:00
autoscaling Fix nested template genearation when attribute path is not string 2018-01-20 04:14:14 +00:00
aws Use StackDefinition in intrinsic functions for resolving data 2017-07-21 10:30:34 -04:00
clients Fix get_watch_server_url for ipv6 addresses 2017-10-06 21:25:27 +00:00
constraints Use more specific asserts in tests 2016-11-22 08:12:35 +01:00
convergence Add converge flag in stack update for observing on reality 2017-08-07 05:39:29 +00:00
db Make standalone heat work with keystone v3 2017-07-17 02:59:03 +00:00
engine Add converge flag in stack update for observing on reality 2017-08-07 05:39:29 +00:00
openstack Fix entropy problems with OS::Random::String 2018-04-05 12:43:13 -04:00
policy Allow policies for resource_types with wildcard 2016-09-28 16:05:32 +05:30
templates Fixes JSON to YAML conversion bug 2015-06-25 07:32:34 -07:00
__init__.py Switch to mox3 2015-10-02 13:05:51 +05:30
common.py Revert "Support attributes with dynamic scheme" 2017-06-26 14:39:11 -04:00
fakes.py Don't use keystoneclient for auth_ref 2017-02-07 14:46:21 +05:30
generic_resource.py Remove the existing snapshots from the backend 2017-09-25 09:43:44 +00:00
test_attributes.py Revert "Support attributes with dynamic scheme" 2017-06-26 14:39:11 -04:00
test_auth_password.py Make standalone heat work with keystone v3 2017-07-17 02:59:03 +00:00
test_auth_url.py Use keystone session in endpoint_utils 2016-09-06 09:48:59 +05:30
test_common_context.py Make standalone heat work with keystone v3 2017-07-17 02:59:03 +00:00
test_common_env_util.py Handle zero values when merging environments 2017-03-02 22:03:20 +01:00
test_common_exception.py Adds error_code in heat exceptions 2015-11-05 18:10:50 +05:30
test_common_param_utils.py Raise HTTPBadRequest instead of ValueError for API validation 2015-05-27 03:48:44 +00:00
test_common_policy.py Allow policies for resource_types with wildcard 2016-09-28 16:05:32 +05:30
test_common_serializers.py py34: heat.tests.test_common_serializers 2015-08-26 13:09:04 +05:30
test_common_service_utils.py datetime.datetime.utcnow() should be replaced 2015-11-10 17:24:51 +00:00
test_constraints.py Add a modulo core constraint 2016-10-11 16:55:11 +02:00
test_convg_stack.py Add converge flag in stack update for observing on reality 2017-08-07 05:39:29 +00:00
test_crypt.py Remove usage of parameter enforce_type 2017-05-08 17:55:32 +08:00
test_dbinstance.py Remove unnecessary setUp and tearDown 2016-09-30 10:56:31 +08:00
test_empty_stack.py Show deprecated warnings when import parser 2015-04-14 17:49:15 +08:00
test_engine_api_utils.py Update StackDefinition resource data when getting outputs 2017-07-21 10:30:34 -04:00
test_engine_service.py Fix reset_stack_status 2017-12-11 11:22:44 +01:00
test_engine_service_stack_watch.py Fix [H405] pep rule in heat/tests 2015-10-12 14:08:16 +03:00
test_environment.py Remove usage of parameter enforce_type 2017-05-08 17:55:32 +08:00
test_environment_format.py Add new environment section for merge strategies 2016-08-19 08:54:30 +05:30
test_event.py Store resource attributes in the DB 2017-06-21 20:18:46 -04:00
test_exception.py Improve StackValidationFailed exception 2017-06-29 09:40:54 +05:30
test_fault_middleware.py Remove usage of parameter enforce_type 2017-05-08 17:55:32 +08:00
test_function.py Use StackDefinition in intrinsic functions for resolving data 2017-07-21 10:30:34 -04:00
test_grouputils.py Move function for member_definitions to grouputil 2015-11-03 09:04:30 +05:30
test_hacking.py Correct mistaken parameters of test_hacking.py in tests 2016-08-19 10:07:22 +08:00
test_hot.py Strip disabled resources from depends_on in add_resource() 2017-09-20 14:37:49 +00:00
test_identifier.py Revert "Revert "Enable heat to use uwsgi with devstack"" 2017-07-07 11:00:04 +05:30
test_lifecycle_plugin_utils.py Use more specific asserts in tests 2016-11-22 08:12:35 +01:00
test_loguserdata.py Remove spurious logs from test_loguserdata 2015-10-29 17:12:34 +01:00
test_metadata_refresh.py Only check service availability during validation 2017-08-01 11:47:14 -04:00
test_nested_stack.py Use StackDefinition in intrinsic functions for resolving data 2017-07-21 10:30:34 -04:00
test_noauth.py Add noauth middleware 2016-10-13 11:49:19 -04:00
test_nokey.py Unit tests: Don't use ResourceDefinition as cfn snippet 2016-05-01 19:42:20 -05:00
test_notifications.py Restore timezone information in API response 2016-09-07 23:29:50 +02:00
test_parameters.py Catch type errors when casting to int 2017-06-16 14:39:56 +02:00
test_plugin_loader.py Use HeatTestCase as parent instead of testtools 2015-03-31 15:17:29 +00:00
test_properties.py Add unit test for translate with no translate value 2017-07-27 02:57:35 +00:00
test_properties_group.py Initial PropertiesGroup implementation 2016-11-07 14:29:17 +03:00
test_provider_template.py Improve StackValidationFailed exception 2017-06-29 09:40:54 +05:30
test_resource.py Protect prepare_update_replace() with resource lock 2018-01-31 17:14:48 +00:00
test_resource_properties_data.py Store resource attributes in the DB 2017-06-21 20:18:46 -04:00
test_rpc_client.py Merge "Use exception_filter in RPC client" 2017-03-29 13:46:53 +00:00
test_rpc_listener_client.py Move listener rpc client to rpc/listener_client.py 2015-06-19 08:24:19 +05:30
test_rpc_worker_client.py Convergence: Cancel message 2016-07-05 07:52:03 +00:00
test_rsrc_defn.py Cache names of required resources in ResourceDefinition 2017-07-21 10:44:51 -04:00
test_server_tags.py Unit tests: Don't use ResourceDefinition as cfn snippet 2016-05-01 19:42:20 -05:00
test_short_id.py Less unicode weirdness in short_id 2017-05-01 16:44:59 -04:00
test_signal.py Revert "Revert "Enable heat to use uwsgi with devstack"" 2017-07-07 11:00:04 +05:30
test_stack.py Set resource._properties_data=None when loading from db 2017-08-30 14:12:05 +00:00
test_stack_collect_attributes.py Cache dep_attrs for all resources in definitions 2017-07-21 10:44:51 -04:00
test_stack_delete.py Remove the existing snapshots from the backend 2017-09-25 09:43:44 +00:00
test_stack_lock.py Don't always eagerly load the raw_template for a stack 2016-10-04 08:25:01 -04:00
test_stack_resource.py Add converge flag in stack update for observing on reality 2017-08-07 05:39:29 +00:00
test_stack_update.py Rollback stack with correct tags 2017-08-22 09:41:30 +08:00
test_stack_user.py Just to migrate existing resource to backup stack 2017-02-10 01:12:32 +00:00
test_support.py Replace tag 2015.2 to 5.0.0 2015-08-06 06:29:09 -04:00
test_template.py Strip disabled resources from depends_on in add_resource() 2017-09-20 14:37:49 +00:00
test_template_files.py del _session(), use context.session directly 2016-06-22 10:45:04 +12:00
test_template_format.py Remove usage of parameter enforce_type 2017-05-08 17:55:32 +08:00
test_timeutils.py Get rid of timeutils.round_to_seconds() 2017-05-04 20:41:34 -04:00
test_translation_rule.py Enable new translation mechanism 2017-04-12 12:02:43 +00:00
test_urlfetch.py Remove usage of parameter enforce_type 2017-05-08 17:55:32 +08:00
test_validate.py Check for circular dependencies in template validation 2017-07-21 10:27:52 -04:00
test_version.py Coverage: Additional test case for better coverage 2015-06-16 13:01:30 +05:30
test_vpc.py Fix is_using_neutron 2016-07-27 22:11:58 +05:30
test_watch.py Use more specific asserts in tests 2016-11-22 08:12:35 +01:00
testing-overview.txt Add alternative way to use debugger for unittets 2015-08-20 16:28:51 +00:00
utils.py Merge "Keep existing stack tags for patch update" 2017-07-24 13:52:51 +00:00