Skip to content

Commit

Permalink
89: added e2e test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Kumari Tanushree committed Sep 6, 2022
1 parent df9179b commit 386eb4a
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions test/e2e/non_typed_char_error_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright 2020 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0
package e2e

import (
"strings"
"testing"
)

func TestNonTypedCharError(t *testing.T) {
env := BuildEnv(t)
logger := Logger{}
kapp := Kapp{t, env.Namespace, env.KappBinaryPath, logger}
kubectl := Kubectl{t, env.Namespace, logger}

yaml := `
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: simple-app
spec:
selector:
matchLabels:
simple-app: ""
template:
metadata:
labels:
simple-app: ""
spec:
containers:
- name: simple-app
image: docker.io/dkalinin/k8s-simple-app@sha256:4c8b96d4fffdfae29258d94a22ae4ad1fe36139d47288b8960d9958d1e63a9d0
env:
- name: HELLO_MSG
value: stranger
envFrom:
---
apiVersion: v1
kind: ConfigMap
metadata:
name: simple-cm
annotations:
kapp.k14s.io/versioned: ""
data:
hello_msg: carvel
`

name := "test-non-typed-character-error"
cleanUp := func() {
kapp.Run([]string{"delete", "-a", name})
}

cleanUp()
defer cleanUp()
logger.Section("Initial deploy", func() {
kapp.RunWithOpts([]string{"deploy", "-a", name, "-f", "-"}, RunOpts{StdinReader: strings.NewReader(yaml)})

NewPresentClusterResource("deployment", "simple-app", env.Namespace, kubectl)
NewPresentClusterResource("configmap", "simple-cm-ver-1", env.Namespace, kubectl)
})
}

0 comments on commit 386eb4a

Please sign in to comment.