Skip to content

Commit

Permalink
WIP: adds test
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleGedd committed Mar 28, 2024
1 parent 0d030d4 commit aa33813
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/bundles/13-dup-pkgs/uds-bundle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
kind: UDSBundle
metadata:
name: dup-pkgs
description: testing a bundle that has duplicated packages
version: 0.0.1

packages:
- name: nginx1
repository: ghcr.io/defenseunicorns/uds-cli/nginx
ref: 0.0.1

- name: nginx2
repository: ghcr.io/defenseunicorns/uds-cli/nginx
ref: 0.0.1
16 changes: 16 additions & 0 deletions src/test/e2e/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ func TestCreateWithNoPath(t *testing.T) {
require.NoError(t, err)
}

func TestBundleWithDupPkgs(t *testing.T) {
deployZarfInit(t)
e2e.CreateZarfPkg(t, "src/test/packages/nginx", false)
bundleDir := "src/test/bundles/13-dup-pkgs"
bundlePath := filepath.Join(bundleDir, fmt.Sprintf("uds-bundle-dup-pkgs-%s-0.0.1.tar.zst", e2e.Arch))

createLocal(t, bundleDir, e2e.Arch)
deploy(t, bundlePath)
defer remove(t, bundlePath)

// ensure there are 2 nginx deployments
cmd := strings.Split("zarf tools kubectl get deploy -n nginx -o=jsonpath='{.items[*].metadata.name}'", " ")
deployments, _, _ := e2e.UDS(cmd...)
require.Equal(t, len(strings.Split(deployments, " ")), 2)
}

func TestBundleWithLocalAndRemotePkgs(t *testing.T) {
deployZarfInit(t)
e2e.SetupDockerRegistry(t, 888)
Expand Down

0 comments on commit aa33813

Please sign in to comment.