ebafe8cddd
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 28s
CI / build (pull_request) Successful in 26s
CI / typecheck (pull_request) Successful in 3m57s
CI / security (pull_request) Successful in 4m3s
CI / quality (pull_request) Successful in 4m6s
CI / integration_tests (pull_request) Successful in 9m11s
CI / unit_tests (pull_request) Successful in 9m22s
CI / docker (pull_request) Successful in 1m0s
CI / coverage (pull_request) Successful in 12m22s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Has been cancelled
CI / e2e_tests (pull_request) Successful in 11m40s
Add --mount flag to 'resource add container-instance' supporting both resource-reference mounts (--mount local/api-repo:/workspace) and host-path mounts (--mount /var/config:/config:ro). - _parse_mount_spec() parses SOURCE:TARGET and SOURCE:TARGET:MODE formats - Resource-reference mounts (containing /) get type='resource', mode='rw' - Host-path mounts support explicit rw/ro mode - Mounts stored as JSON string in resource properties['mounts'] - _format_properties() renders mounts in human-readable format for 'resource show' - Added mount to container-instance cli_args metadata - 6 Behave scenarios testing single mount, dual mount, persistence, and error paths - Updated CHANGELOG ISSUES CLOSED: #1078
65 lines
3.1 KiB
Gherkin
65 lines
3.1 KiB
Gherkin
@container-mount
|
|
Feature: container-instance --mount flag
|
|
Verifies that resource add container-instance accepts --mount flags
|
|
for both resource-reference and host-path mount specifications.
|
|
|
|
Scenario: Single resource-reference mount for mount_flag
|
|
Given a resource registry service for mount_flag
|
|
When I add a container-instance with mount "local/api-repo:/workspace" for mount_flag
|
|
Then the mount_flag resource should have 1 mount
|
|
And mount_flag mount 0 source should be "local/api-repo"
|
|
And mount_flag mount 0 target should be "/workspace"
|
|
And mount_flag mount 0 mode should be "rw"
|
|
And mount_flag mount 0 type should be "resource"
|
|
|
|
Scenario: Single host-path mount with ro mode for mount_flag
|
|
Given a resource registry service for mount_flag
|
|
When I add a container-instance with mount "/var/config:/config:ro" for mount_flag
|
|
Then the mount_flag resource should have 1 mount
|
|
And mount_flag mount 0 source should be "/var/config"
|
|
And mount_flag mount 0 target should be "/config"
|
|
And mount_flag mount 0 mode should be "ro"
|
|
And mount_flag mount 0 type should be "bind"
|
|
|
|
Scenario: Dual mount per WF17 spec for mount_flag
|
|
Given a resource registry service for mount_flag
|
|
When I add a container-instance with mounts for mount_flag:
|
|
| mount_spec |
|
|
| local/api-repo:/workspace |
|
|
| /var/shared/config:/config:ro |
|
|
Then the mount_flag resource should have 2 mounts
|
|
And mount_flag mount 0 source should be "local/api-repo"
|
|
And mount_flag mount 0 target should be "/workspace"
|
|
And mount_flag mount 0 mode should be "rw"
|
|
And mount_flag mount 1 source should be "/var/shared/config"
|
|
And mount_flag mount 1 target should be "/config"
|
|
And mount_flag mount 1 mode should be "ro"
|
|
|
|
Scenario: Mount info persisted and retrievable for mount_flag
|
|
Given a resource registry service for mount_flag
|
|
When I add a container-instance with mount "local/repo:/app" for mount_flag
|
|
And I show the mount_flag resource
|
|
Then the mount_flag show output should contain "local/repo"
|
|
And the mount_flag show output should contain "/app"
|
|
|
|
Scenario: Absolute host path 2-part mount is bind type for mount_flag
|
|
Given a resource registry service for mount_flag
|
|
When I add a container-instance with mount "/data:/app" for mount_flag
|
|
Then the mount_flag resource should have 1 mount
|
|
And mount_flag mount 0 source should be "/data"
|
|
And mount_flag mount 0 target should be "/app"
|
|
And mount_flag mount 0 type should be "bind"
|
|
And mount_flag mount 0 mode should be "rw"
|
|
|
|
Scenario: Mount rejected on non-container type for mount_flag
|
|
When I parse mount spec "local/repo:/app" for mount_flag on type "git-checkout"
|
|
Then mount_flag type validation should fail
|
|
|
|
Scenario: Invalid mount mode rejected for mount_flag
|
|
When I parse mount spec "/src:/dst:rx" for mount_flag
|
|
Then mount_flag parse should fail with "Invalid mount mode"
|
|
|
|
Scenario: Invalid mount format rejected for mount_flag
|
|
When I parse mount spec "a:b:c:d" for mount_flag
|
|
Then mount_flag parse should fail with "Invalid mount spec"
|