-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: adding test for init validation (#629)
- Loading branch information
1 parent
c18ceab
commit 2b01145
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package e2e | ||
|
||
import ( | ||
"strings" | ||
"testing" | ||
) | ||
|
||
func TestInitVaidationContainer(t *testing.T) { | ||
cmd := kubectl("get", "pod", "-l", "app=aci-connector-linux", "-n", "kube-system", "-o", "jsonpath={.items[1].status.phase}") | ||
|
||
out, err := cmd.CombinedOutput() | ||
if err != nil { | ||
t.Fatal(string(out)) | ||
} | ||
if string(out) != "Running" { | ||
t.Fatal("pod is not in running state") | ||
} | ||
|
||
cmd = kubectl("logs", "-l", "app=aci-connector-linux", "-c", "init-validation", "-n", "kube-system", "--tail=1") | ||
logOut, logErr := cmd.CombinedOutput() | ||
if logErr != nil { | ||
t.Fatal(string(out)) | ||
} | ||
if !strings.Contains(string(logOut), "initial setup for virtual kubelet Azure ACI is successful") { | ||
t.Fatalf("init container setup is not successful. log: %s", string(logOut)) | ||
} | ||
} |