Skip to content

Commit

Permalink
test: replace import with imports, add one explicit legacy import test
Browse files Browse the repository at this point in the history
This just changes all the existing tests to test 'imports' rather
than 'import'.  Then it adds one test for 'import' explicitly
and within the same stacker file.

Signed-off-by: Scott Moser <smoser@brickies.net>
  • Loading branch information
smoser committed Nov 13, 2023
1 parent 1c8e748 commit 1d7c9d6
Show file tree
Hide file tree
Showing 16 changed files with 108 additions and 81 deletions.
6 changes: 3 additions & 3 deletions test/basic.bats
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ centos:
from:
type: oci
url: $CENTOS_OCI
import: import
imports: import
EOF
echo 1 > import
stacker build
Expand All @@ -32,7 +32,7 @@ centos:
from:
type: tar
url: .stacker/layer-bases/centos.tar
import:
imports:
- ./stacker.yaml
- https://www.cisco.com/favicon.ico
- ./executable
Expand Down Expand Up @@ -198,7 +198,7 @@ centos:
from:
type: tar
url: .stacker/layer-bases/centos.tar
import:
imports:
- ./stacker.yaml
- https://www.cisco.com/favicon.ico
- ./executable
Expand Down
2 changes: 1 addition & 1 deletion test/broken-link.bats
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ broken_link:
from:
type: oci
url: $CENTOS_OCI
import:
imports:
- dir
run: cp -a /stacker/imports/dir/testln /testln
EOF
Expand Down
8 changes: 4 additions & 4 deletions test/build-only.bats
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ centos:
from:
type: oci
url: $CENTOS_OCI
import: https://www.cisco.com/favicon.ico
imports: https://www.cisco.com/favicon.ico
run: |
cp /stacker/imports/favicon.ico /favicon.ico
build_only: true
layer1:
from:
type: built
tag: centos
import:
imports:
- stacker://centos/favicon.ico
run:
- cp /stacker/imports/favicon.ico /favicon2.ico
Expand All @@ -108,15 +108,15 @@ centos:
from:
type: oci
url: $CENTOS_OCI
import: https://www.cisco.com/favicon.ico
imports: https://www.cisco.com/favicon.ico
run: |
cp /stacker/imports/favicon.ico /favicon.ico
build_only: true
layer1:
from:
type: built
tag: centos
import:
imports:
- stacker://centos/favicon.ico
run:
- cp /stacker/imports/favicon.ico /favicon2.ico
Expand Down
14 changes: 7 additions & 7 deletions test/caching.bats
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ base:
from:
type: built
tag: build-base
import:
imports:
- foo
run: |
cp /stacker/imports/foo /foo
Expand All @@ -71,7 +71,7 @@ import-cache:
from:
type: oci
url: $CENTOS_OCI
import:
imports:
- link/foo
run: cp /stacker/imports/foo/zomg /zomg
EOF
Expand All @@ -95,7 +95,7 @@ a:
from:
type: oci
url: $CENTOS_OCI
import:
imports:
- foo
run: |
[ -f /stacker/imports/foo/bar ]
Expand All @@ -111,7 +111,7 @@ a:
from:
type: oci
url: $CENTOS_OCI
import:
imports:
- foo
run: |
[ ! -f /stacker/imports/foo/bar ]
Expand All @@ -126,7 +126,7 @@ bind-test:
from:
type: oci
url: ${{CENTOS_OCI}}
import:
imports:
- tree1/foo/zomg
binds:
- ${{bind_path}} -> /root/tree2/foo
Expand Down Expand Up @@ -169,7 +169,7 @@ mode-test:
from:
type: oci
url: $CENTOS_OCI
import:
imports:
- executable
run: cp /stacker/imports/executable /executable
EOF
Expand Down Expand Up @@ -204,7 +204,7 @@ test:
from:
type: oci
url: $CENTOS_OCI
import:
imports:
- foo
run: cp /stacker/imports/foo /foo
EOF
Expand Down
2 changes: 1 addition & 1 deletion test/cp-not-required.bats
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ contents2:
from:
type: built
tag: build
import:
imports:
- stacker://contents/first
- stacker://contents/second
run: |
Expand Down
4 changes: 2 additions & 2 deletions test/dependency-order.bats
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test:
from:
type: oci
tag: $CENTOS_OCI
import:
imports:
- stacker://foo/bar
- stacker://baz/foo
EOF
Expand Down Expand Up @@ -74,7 +74,7 @@ installer-iso-build:
type: built
tag: minbase1
build_only: true
import:
imports:
- stacker://installer-initrd/output/installer-initrd-base.cpio
- stacker://installer-initrd-modules/output/installer-initrd-modules.cpio
run: |
Expand Down
2 changes: 1 addition & 1 deletion test/docker-base.bats
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ centos:
from:
type: docker
url: docker://centos:latest
import:
imports:
- https://www.cisco.com/favicon.ico
run: |
cp /stacker/imports/favicon.ico /favicon.ico
Expand Down
4 changes: 2 additions & 2 deletions test/import-http.bats
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ img:
from:
type: oci
url: $(pwd)/oci:centos_base
import:
imports:
- http://network-test.debian.org/nm
run: |
cp /stacker/imports/nm /root/nm
Expand Down Expand Up @@ -79,7 +79,7 @@ centos_base:
from:
type: oci
url: $CENTOS_OCI
import:
imports:
- path: https://www.cisco.com/favicon.ico
dest: /dest/icon
run: |
Expand Down
Loading

0 comments on commit 1d7c9d6

Please sign in to comment.