NAME
Kernel::Test::Role::Environment::HandlesSimpleStorageService – role to start / stop simple storage service.
PUBLIC INTERFACE
has 'NeedsRunningS3'
this attribute controls if the simple storage service is expected to be running or not running (default) during the execution of the test case. Override it to change the default value like this:
has '+NeedsRunningS3' => (
default => 1,
);
has 'S3Config'
Attribute that holds the simple storage service related configuration.
- Endpoint
- Region
- Bucket
- AwsAccessKey
- AwsSecretKey
- HealthCheck
around 'StartHook'
starts the simple storage service at the beginning of the test, if needed.
around 'FinishHook'
stops the simple storage service at the end of the test, if it was explicit started.
IsS3Running
Verify "any" simple storage service is running by a simple socket connection to the configured endpoint
.
StartS3
Start simple storage service https://min.io. The method returns silent if any other service is already running and croaks on any failure.
StopS3
Stop explicit by test started simple storage service https://min.io. Optional recursively clean up data directory.
GetS3Config
Fetch simple storage service settings from configuration file or use default settings.
CheckS3Environment
Verify simple requirements are available.
- Perl Amazon Web Services Software Development Kit – https://metacpan.org/pod/Paws
- Simple storage service binary – https://min.io
Method croaks if any requirement is missing.