summaryrefslogtreecommitdiff
path: root/test/e2e/common_test.go
diff options
context:
space:
mode:
authorLokesh Mandvekar <lsm5@fedoraproject.org>2022-03-08 15:07:55 -0500
committerLokesh Mandvekar <lsm5@fedoraproject.org>2022-03-08 15:07:55 -0500
commit8cfdddf5092b5d3fc0c154b241325ecbf4480825 (patch)
treee2193962c716fafa229baff01665a758285be799 /test/e2e/common_test.go
parenta08e4e5b4657469a5d686ec5621f681cd240f6e7 (diff)
downloadpodman-8cfdddf5092b5d3fc0c154b241325ecbf4480825.tar.gz
podman-8cfdddf5092b5d3fc0c154b241325ecbf4480825.tar.bz2
podman-8cfdddf5092b5d3fc0c154b241325ecbf4480825.zip
test/e2e: add aardvark specific tests
Co-authored-by: Brent Baude <bbaude@redhat.com> Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
Diffstat (limited to 'test/e2e/common_test.go')
-rw-r--r--test/e2e/common_test.go26
1 files changed, 25 insertions, 1 deletions
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go
index b1cd76d27..bc6d89fad 100644
--- a/test/e2e/common_test.go
+++ b/test/e2e/common_test.go
@@ -896,7 +896,7 @@ func removeConf(confPath string) {
}
}
-// generateNetworkConfig generates a cni config with a random name
+// generateNetworkConfig generates a CNI or Netavark config with a random name
// it returns the network name and the filepath
func generateNetworkConfig(p *PodmanTestIntegration) (string, string) {
var (
@@ -1042,3 +1042,27 @@ func ncz(port int) bool {
func createNetworkName(name string) string {
return name + stringid.GenerateNonCryptoID()[:10]
}
+
+var IPRegex = `(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}`
+
+// digShort execs into the given container and does a dig lookup with a timeout
+// backoff. If it gets a response, it ensures that the output is in the correct
+// format and iterates a string array for match
+func digShort(container, lookupName string, matchNames []string, p *PodmanTestIntegration) string {
+ digInterval := time.Millisecond * 250
+ for i := 0; i < 6; i++ {
+ time.Sleep(digInterval * time.Duration(i))
+ dig := p.Podman([]string{"exec", container, "dig", "+short", lookupName})
+ dig.WaitWithDefaultTimeout()
+ if dig.ExitCode() == 0 {
+ output := dig.OutputToString()
+ Expect(output).To(MatchRegexp(IPRegex))
+ for _, name := range matchNames {
+ Expect(output).To(Equal(name))
+ }
+ return output
+ }
+ }
+ Fail("dns is not responding")
+ return ""
+}