|
37 | 37 |
|
38 | 38 | with test.step("Configure data interface with static IPv4"): |
39 | 39 | _, ifname = env.ltop.xlate("target", "data") |
40 | | - target.put_config_dict("ietf-interfaces", { |
41 | | - "interfaces": { |
42 | | - "interface": [{ |
43 | | - "name": f"{ifname}", |
44 | | - "ipv4": { |
45 | | - "address": [{ |
46 | | - "ip": f"{DUTIP}", |
47 | | - "prefix-length": 24 |
48 | | - }] |
49 | | - } |
50 | | - }] |
| 40 | + target.put_config_dicts({ |
| 41 | + "ietf-interfaces": { |
| 42 | + "interfaces": { |
| 43 | + "interface": [{ |
| 44 | + "name": f"{ifname}", |
| 45 | + "ipv4": { |
| 46 | + "address": [{ |
| 47 | + "ip": f"{DUTIP}", |
| 48 | + "prefix-length": 24 |
| 49 | + }] |
| 50 | + } |
| 51 | + }] |
| 52 | + } |
51 | 53 | } |
52 | 54 | }) |
53 | 55 |
|
|
62 | 64 | for var in ENV_VARS: |
63 | 65 | cgi.append(f'echo "{var["key"]}=${var["key"]}"') |
64 | 66 |
|
65 | | - target.put_config_dict("infix-containers", { |
66 | | - "containers": { |
67 | | - "container": [ |
68 | | - { |
69 | | - "name": f"{NAME}", |
70 | | - "image": f"oci-archive:{infamy.Container.HTTPD_IMAGE}", |
71 | | - "command": "/usr/sbin/httpd -f -v -p 8080", |
72 | | - "env": ENV_VARS, |
73 | | - "network": { |
74 | | - "host": True |
75 | | - }, |
76 | | - "mount": [ |
77 | | - { |
78 | | - "name": "env.cgi", |
79 | | - "content": to_binary('\n'.join(cgi) + '\n'), |
80 | | - "target": "/var/www/cgi-bin/env.cgi", |
81 | | - "mode": "0755" |
82 | | - } |
83 | | - ], |
84 | | - "volume": [{ |
85 | | - "name": "www", |
86 | | - "target": "/var/www" |
87 | | - }] |
88 | | - } |
89 | | - ] |
| 67 | + target.put_config_dicts({ |
| 68 | + "infix-containers": { |
| 69 | + "containers": { |
| 70 | + "container": [ |
| 71 | + { |
| 72 | + "name": f"{NAME}", |
| 73 | + "image": f"oci-archive:{infamy.Container.HTTPD_IMAGE}", |
| 74 | + "command": "/usr/sbin/httpd -f -v -p 8080", |
| 75 | + "env": ENV_VARS, |
| 76 | + "network": { |
| 77 | + "host": True |
| 78 | + }, |
| 79 | + "mount": [ |
| 80 | + { |
| 81 | + "name": "env.cgi", |
| 82 | + "content": to_binary('\n'.join(cgi) + '\n'), |
| 83 | + "target": "/var/www/cgi-bin/env.cgi", |
| 84 | + "mode": "0755" |
| 85 | + } |
| 86 | + ], |
| 87 | + "volume": [{ |
| 88 | + "name": "www", |
| 89 | + "target": "/var/www" |
| 90 | + }] |
| 91 | + } |
| 92 | + ] |
| 93 | + } |
90 | 94 | } |
91 | 95 | }) |
92 | 96 |
|
|
115 | 119 | {"key": "PATH_WITH_SPACES", "value": "/path with spaces/test"} |
116 | 120 | ] |
117 | 121 |
|
118 | | - target.put_config_dict("infix-containers", { |
119 | | - "containers": { |
120 | | - "container": [{ |
121 | | - "name": f"{NAME}", |
122 | | - "env": UPDATED_ENV_VARS, |
123 | | - }] |
| 122 | + target.put_config_dicts({ |
| 123 | + "infix-containers": { |
| 124 | + "containers": { |
| 125 | + "container": [{ |
| 126 | + "name": f"{NAME}", |
| 127 | + "env": UPDATED_ENV_VARS, |
| 128 | + }] |
| 129 | + } |
124 | 130 | } |
125 | 131 | }) |
126 | 132 |
|
|
0 commit comments