|
6 | 6 | given a physical interface instead of an end of a VETH pair. |
7 | 7 | """ |
8 | 8 | import infamy |
9 | | -from infamy.util import until, to_binary |
| 9 | +from infamy.util import until, to_binary, curl |
10 | 10 |
|
11 | 11 | with infamy.Test() as test: |
12 | 12 | NAME = "web-phys" |
13 | 13 | DUTIP = "10.0.0.2" |
14 | 14 | OURIP = "10.0.0.1" |
15 | | - MESG = "Kilroy was here" |
16 | | - BODY = f"<html><body><p>{MESG}</p></body></html>" |
| 15 | + MESG1 = "It works" |
| 16 | + MESG2 = "Kilroy was here" |
| 17 | + BODY = f"<html><body><p>{MESG2}</p></body></html>" |
17 | 18 | URL = f"http://{DUTIP}:91/index.html" |
18 | 19 |
|
19 | 20 | with test.step("Set up topology and attach to target DUT"): |
|
60 | 61 | until(lambda: c.running(NAME), attempts=60) |
61 | 62 |
|
62 | 63 | _, hport = env.ltop.xlate("host", "data") |
63 | | - url = infamy.Furl(URL) |
64 | 64 |
|
65 | 65 | with infamy.IsolatedMacVlan(hport) as ns: |
66 | 66 | ns.addip(OURIP) |
67 | 67 | with test.step("Verify host:data can ping 10.0.0.2"): |
68 | 68 | ns.must_reach(DUTIP) |
69 | 69 |
|
70 | 70 | with test.step("Verify container is reachable on http://10.0.0.2:91"): |
71 | | - until(lambda: url.nscheck(ns, "It works"), attempts=10) |
| 71 | + until(lambda: MESG1 in ns.call(lambda: curl(URL)), attempts=10) |
72 | 72 |
|
73 | 73 | with test.step("Add a content mount, overriding index.html"): |
74 | 74 | # Verify modifying a running container takes, issue #930 |
|
88 | 88 | }) |
89 | 89 |
|
90 | 90 | with test.step("Verify server is restarted and returns new content"): |
91 | | - until(lambda: url.nscheck(ns, MESG), attempts=60) |
| 91 | + until(lambda: MESG2 in ns.call(lambda: curl(URL)), attempts=60) |
92 | 92 |
|
93 | 93 | test.succeed() |
0 commit comments