simpkv_test::remove_folders
: Remove folders using simpkv::deletetreesimpkv_test::remove_keys
: Remove keys using simpkv::deletesimpkv_test::retrieve_and_verify_folders
: Retrieve folder lists with simpkv::list and verify the resultsimpkv_test::retrieve_and_verify_keys
: Retrieve keys with simpkv::get and verifies the resultssimpkv_test::store_keys
: Store keys using simpkv::putsimpkv_test::verify_folders_exist
: Check for the existence of folders using simpkv::existssimpkv_test::verify_keys_exist
: Check for the existence of keys using simpkv::exists
simpkv_test::defines::remove_folder
: Define that simply calls simpkv::deletetreesimpkv_test::defines::remove_key
: Define that simply calls simpkv::deletesimpkv_test::defines::retrieve_and_verify_folder
: Define that calls simpkv::list and validates its resultsimpkv_test::defines::retrieve_and_verify_key
: Define that calls simpkv::get and validates its resultsimpkv_test::defines::store_key
: Define that simply calls simpkv::putsimpkv_test::defines::verify_name_exists
: Define that calls simpkv::exists and validates its result
simpkv_test::assert_equal
: Compare 2 values and fail if they differsimpkv_test::code_source
: "Randomly" assigns the code source from which a simpkv function will be called.simpkv_test::key_value
: Returns key value specified by$key_data
simpkv_test::puppet_functions::remove_folder
: Puppet language function that simply calls simpkv::deletetreesimpkv_test::puppet_functions::remove_key
: Puppet language function that simply calls simpkv::deletesimpkv_test::puppet_functions::retrieve_and_verify_folder
: Puppet language function that calls simpkv::list and validates its resultsimpkv_test::puppet_functions::retrieve_and_verify_key
: Puppet language function that calls simpkv::get and validates its result.simpkv_test::puppet_functions::store_key
: Puppet language function that simply calls simpkv::putsimpkv_test::puppet_functions::verify_name_exists
: Puppet language function that calls simpkv::exists and validates its result.simpkv_test::simpkv_options
: Generates simpkv_options Hash for use in simpkv function callssimpkv_test::verify_folder_data
: Compare expected and actual folder contents and fail if they differsimpkv_test::verify_key_data
: Compare expected and actual key data and fail if they differ
Simpkv_test::AppId
: String used as theapp_id
attribute of thesimpkv_options
parameter in a simpkv function callSimpkv_test::FolderData
: Information about an individual folder in a keystoreSimpkv_test::FolderInfo
: Data structure specifying folder information Folders are unique based on 3 attributes: 1. The backend in which they are stored 2. WhetherSimpkv_test::Folders
: Data structure specifying folder listingsSimpkv_test::Key
: Key or folder name The regex is not perfect (doesn't catch sequences that look like relative paths), but sufficient for this test module.Simpkv_test::KeyData
: Information about an individual key in a keystoreSimpkv_test::KeyInfo
: Data structure specifying key information Keys are unique based on 3 attributes: 1. The backend in which they are stored 2. Whether they aSimpkv_test::Keys
: Data structure specifying key/value pairsSimpkv_test::NameInfo
: Data structure specifying simply key/folder names Key/folder names are unique based on 3 attributes: 1. The backend in which they are storeSimpkv_test::NonBinaryKeyData
: Information about an individual non-binary key in a keystore
Remove folders using simpkv::deletetree
The following parameters are available in the simpkv_test::remove_folders
class:
Data type: Simpkv_test::NameInfo
Info specifying the names of the folders to remove
Remove keys using simpkv::delete
The following parameters are available in the simpkv_test::remove_keys
class:
Data type: Simpkv_test::NameInfo
Info specifying the names of keys to remove
Retrieve folder lists with simpkv::list and verify the result
The following parameters are available in the simpkv_test::retrieve_and_verify_folders
class:
Data type: Simpkv_test::FolderInfo
Info specifying folders that are expected to be present in the keystore and their contents
Data type: Simpkv_test::FolderInfo
Info specifying folders that are not expected to be present in the keystore
Retrieve keys with simpkv::get and verifies the results
The following parameters are available in the simpkv_test::retrieve_and_verify_keys
class:
Data type: Simpkv_test::KeyInfo
Info specifying keys that are expected to be present in the keystore and their stored data
Data type: Simpkv_test::KeyInfo
Info specifying keys that are not expected to be present in the keystore
Store keys using simpkv::put
The following parameters are available in the simpkv_test::store_keys
class:
Data type: Simpkv_test::KeyInfo
Info specifying the key names and data to be stored
Check for the existence of folders using simpkv::exists
The following parameters are available in the simpkv_test::verify_folders_exist
class:
Data type: Simpkv_test::NameInfo
Info specifying names of folder that are expected to be present in the keystore
Data type: Simpkv_test::NameInfo
Info specifying names of folder that are not expected to be present in the keystore
Check for the existence of keys using simpkv::exists
The following parameters are available in the simpkv_test::verify_keys_exist
class:
Data type: Simpkv_test::NameInfo
Info specifying names of keys that are expected to be present in the keystore
Data type: Simpkv_test::NameInfo
Info specifying names of keys that are not expected to be present in the keystore
Define that simply calls simpkv::deletetree
The following parameters are available in the simpkv_test::defines::remove_folder
defined type:
Data type: Simpkv_test::Key
Name of the folder to remove
Data type: Hash
Value of the simpkv_options parameter to be used in the simpkv::deletetree function call
Default value: {}
Define that simply calls simpkv::delete
The following parameters are available in the simpkv_test::defines::remove_key
defined type:
Data type: Simpkv_test::Key
Name of the key to remove
Data type: Hash
Value of the simpkv_options parameter to be used in the simpkv::delete function call
Default value: {}
Fails if validation fails.
The following parameters are available in the simpkv_test::defines::retrieve_and_verify_folder
defined type:
Data type: Simpkv_test::Key
Name of the folder to be listed
Data type: Variant[Hash[Simpkv_test::Key,Simpkv_test::NonBinaryKeyData],Undef]
Expected key data
Data type: Variant[Array[String[1]],Undef]
Expected folder data
Data type: Hash
Value of the simpkv_options parameter to be used in the simpkv::list function call
Default value: {}
Fails if validation fails.
The following parameters are available in the simpkv_test::defines::retrieve_and_verify_key
defined type:
Data type: Simpkv_test::Key
Name of the key to be retrieved
Data type: Any
Expected key value
Data type: Variant[Hash,Undef]
Expected key metadata
Data type: Hash
Value of the simpkv_options parameter to be used in the simpkv::get function call
Data type: Boolean
Whether the key has a binary value
Define that simply calls simpkv::put
The following parameters are available in the simpkv_test::defines::store_key
defined type:
Data type: Simpkv_test::Key
Name of the key to store
Data type: NotUndef
Value to store
Data type: Hash
Metadata to store
Default value: {}
Data type: Hash
Value of the simpkv_options parameter to be used in the simpkv::put function call
Default value: {}
Fails if validation fails.
The following parameters are available in the simpkv_test::defines::verify_name_exists
defined type:
Data type: Simpkv_test::Key
Name of the key/folder whose existence is to be checked
Data type: Hash
Value of the simpkv_options parameter to be used in the simpkv::exists function call
Default value: {}
Data type: Boolean
Whether key/folder should exist
Type: Puppet Language
Compare 2 values and fail if they differ
The simpkv_test::assert_equal function.
Returns: None
Data type: Any
Actual value
Data type: Any
Expected value
Data type: String
Explanatory text that is added to the failure message
Type: Puppet Language
"Randomly" assigns the code source from which a simpkv function will be called.
The simpkv_test::code_source function.
Returns: Enum['class', 'define', 'puppet_function']
Data type: String
Id of the key/folder used in the simpkv function
- Used as the random generator seed
Type: Puppet Language
Transforms to Binary as necessary, or undef if the value cannot be determined.
Transforms to Binary as necessary, or undef if the value cannot be determined.
Returns: Any
Data type: Simpkv_test::KeyData
Key specification
Type: Puppet Language
Puppet language function that simply calls simpkv::deletetree
The simpkv_test::puppet_functions::remove_folder function.
Returns: None
Data type: Simpkv_test::Key
Name of the folder to remove
Data type: Hash
Value of the simpkv_options parameter to be used in the simpkv::deletetree function call
Type: Puppet Language
Puppet language function that simply calls simpkv::delete
The simpkv_test::puppet_functions::remove_key function.
Returns: None
Data type: Simpkv_test::Key
Name of the key to remove
Data type: Hash
Value of the simpkv_options parameter to be used in the simpkv::delete function call
Type: Puppet Language
Fails if validation fails.
simpkv_test::puppet_functions::retrieve_and_verify_folder(Simpkv_test::Key $folder, Variant[Hash[Simpkv_test::Key,Simpkv_test::NonBinaryKeyData],Undef] $expected_keys, Variant[Array[String[1]],Undef] $expected_folders, Hash $simpkv_options = {})
Fails if validation fails.
Returns: None
Data type: Simpkv_test::Key
Name of the folder to be listed
Data type: Variant[Hash[Simpkv_test::Key,Simpkv_test::NonBinaryKeyData],Undef]
Expected key data
Data type: Variant[Array[String[1]],Undef]
Expected folder data
Data type: Hash
Value of the simpkv_options parameter to be used in the simpkv::list function call
Type: Puppet Language
Fails if validation fails.
simpkv_test::puppet_functions::retrieve_and_verify_key(Simpkv_test::Key $key, Any $expected_value, Variant[Hash,Undef] $expected_metadata, Hash $simpkv_options, Boolean $binary)
Fails if validation fails.
Returns: None
Data type: Simpkv_test::Key
Name of the key to be retrieved
Data type: Any
Expected key value
Data type: Variant[Hash,Undef]
Expected key metadata
Data type: Hash
Value of the simpkv_options parameter to be used in the simpkv::get function call
Data type: Boolean
Whether the key has a binary value
Type: Puppet Language
Puppet language function that simply calls simpkv::put
simpkv_test::puppet_functions::store_key(Simpkv_test::Key $key, NotUndef $value, Hash $metadata, Hash $simpkv_options)
The simpkv_test::puppet_functions::store_key function.
Returns: None
Data type: Simpkv_test::Key
Name of the key to store
Data type: NotUndef
Value to store
Data type: Hash
Metadata to store
Data type: Hash
Value of the simpkv_options parameter to be used in the simpkv::put function call
Type: Puppet Language
Fails if validation fails.
simpkv_test::puppet_functions::verify_name_exists(Simpkv_test::Key $key, Hash $simpkv_options, Boolean $valid)
Fails if validation fails.
Returns: None
Data type: Simpkv_test::Key
Name of the key/folder whose existence is to be checked
Data type: Hash
Value of the simpkv_options parameter to be used in the simpkv::exists function call
Data type: Boolean
Whether key/folder should exist
Type: Puppet Language
Generates simpkv_options Hash for use in simpkv function calls
simpkv_test::simpkv_options(Simpkv_test::AppId $app_id, Enum['env', 'global'] $key_type, Hash $other_options = {})
The simpkv_test::simpkv_options function.
Returns: Hash
Data type: Simpkv_test::AppId
app_id
to be set in the simpkv_options Hash
- Ignored when an empty string
Data type: Enum['env', 'global']
The key/folder type
- 'env': key/folder is tied to a Puppet environment
- 'global': key/folder is global
Data type: Hash
Other options to be set in the returned simpkv_options Hash
Type: Puppet Language
Compare expected and actual folder contents and fail if they differ
simpkv_test::verify_folder_data(Variant[Hash,Undef] $list_result, Variant[Hash[Simpkv_test::Key,Simpkv_test::NonBinaryKeyData],Undef] $expected_keys, Variant[Array[String[1]],Undef] $expected_folders, String[1] $message)
The simpkv_test::verify_folder_data function.
Returns: None
Data type: Variant[Hash,Undef]
The actual simpkv::list
result
Data type: Variant[Hash[Simpkv_test::Key,Simpkv_test::NonBinaryKeyData],Undef]
Expected key data
Data type: Variant[Array[String[1]],Undef]
Expected folder data
Data type: String[1]
Explanatory text that is added to the failure message, if the comparison fails
Type: Puppet Language
Compare expected and actual key data and fail if they differ
simpkv_test::verify_key_data(Variant[Hash,Undef] $get_result, Any $expected_value, Variant[Hash,Undef] $expected_metadata, Boolean $binary, String[1] $message)
The simpkv_test::verify_key_data function.
Returns: None
Data type: Variant[Hash,Undef]
The actual simpkv::get
result
Data type: Any
Expected key value
Data type: Variant[Hash,Undef]
Expected key metadata
Data type: Boolean
Whether the key has a binary value
Data type: String[1]
Explanatory text that is added to the failure message, if the comparison fails
String used as the app_id
attribute of the simpkv_options
parameter in
a simpkv function call
Alias of
String
Information about an individual folder in a keystore
Alias of
Struct[{
# Info about keys in the directory
# - Currently restricted to keys with non-binary data because of
# test manifest limitations
Optional[keys] => Hash[Simpkv_test::Key,Simpkv_test::NonBinaryKeyData],
# List of subfolder names
Optional[folders] => Array[String[1]]
}]
Data structure specifying folder information
Folders are unique based on 3 attributes:
- The backend in which they are stored
- Whether they are tied to a Puppet environment or global
- The folder names (each of which may include a relative path)
The grouping below was chosen to ensure uniqueness for test folders,
ASSUMING, backends are uniquely mapped to the app_id
attribute that
will be used in the simpkv_options
parameter of each simpkv function call.
If you are mapping multiple app_id
values to the same backend in a test,
be sure you don't have any folders that will resolve to the same storage
location!
Alias of
Hash[Simpkv_test::AppId, Struct[{
# - Any folder in 'env' is a folder tied to the Puppet environment.
# - Any folder in 'global' is a global folder.
# - For these folders, the 'global' attribute of the `simpkv_options`
# parameter of each simpkv function call will be automatically set
# to `true`.
Optional[env] => Simpkv_test::Folders,
Optional[global] => Simpkv_test::Folders
}]]
Data structure specifying folder listings
Alias of
Hash[Simpkv_test::Key, Simpkv_test::FolderData]
Key or folder name
The regex is not perfect (doesn't catch sequences that look like relative paths), but sufficient for this test module.
Alias of
Pattern['^[a-z0-9._:\-\/]+$']
Information about an individual key in a keystore
Alias of
Struct[{
# Either 'value' or 'file' needs to be set.
# If both are set, 'value' will be used over 'file'.
# If neither are set, the Simpkv_test::KeyData instance will be skipped.
# Non-binary value
Optional[value] => NotUndef,
# File containing binary value
# - argument to binary_file, which is an absolute path or
# <module name>/<file name> string referencing a module file
Optional[file] => String[1],
# Optional metadata stored with the value
Optional[metadata] => Hash
}]
Data structure specifying key information
Keys are unique based on 3 attributes:
- The backend in which they are stored
- Whether they are tied to a Puppet environment or global
- The key names (each of which may include a relative folder path)
The grouping below was chosen to ensure uniqueness for test keys,
ASSUMING, backends are uniquely mapped to the app_id
attribute that
will be used in the simpkv_options
parameter of each simpkv function call.
If you are mapping multiple app_id
values to the same backend in a test,
be sure you don't have any keys that will resolve to the same storage
location!
Alias of
Hash[Simpkv_test::AppId, Struct[{
# - Any key in 'env' is a key tied to the Puppet environment.
# - Any key in 'global' is a global key.
# - For these keys, the 'global' attribute of the `simpkv_options`
# parameter of each simpkv function call will be automatically set
# to `true`.
Optional[env] => Simpkv_test::Keys,
Optional[global] => Simpkv_test::Keys
}]]
Data structure specifying key/value pairs
Alias of
Hash[Simpkv_test::Key, Simpkv_test::KeyData]
Data structure specifying simply key/folder names
Key/folder names are unique based on 3 attributes:
- The backend in which they are stored
- Whether they are tied to a Puppet environment or global
- The key/folder names (each of which may include a relative folder path)
The grouping below was chosen to ensure uniqueness for test key/folder names,
ASSUMING, backends are uniquely mapped to the app_id
attribute that
will be used in the simpkv_options
parameter of each simpkv function call.
If you are mapping multiple app_id
values to the same backend in a test,
be sure you don't have any keys/folders that will resolve to the same storage
location!
Alias of
Hash[Simpkv_test::AppId, Struct[{
# - Any key/folder in 'env' is tied to the Puppet environment.
# - Any key/folder in 'global' is global
# - For these entities, the 'global' attribute of the `simpkv_options`
# parameter of each simpkv function call will be automatically set
# to `true`.
Optional[env] => Array[Simpkv_test::Key],
Optional[global] => Array[Simpkv_test::Key]
}]]
Information about an individual non-binary key in a keystore
Alias of
Struct[{
# Non-binary value
value => NotUndef,
# Optional metadata stored with the value
Optional[metadata] => Hash
}]