(self)
| 125 | return indicies |
| 126 | |
| 127 | def test_api_map_domains_get(self): |
| 128 | # Create a bunch of domains |
| 129 | no_domains = 4096 # This must be large enough to ensure VPP suspends |
| 130 | domains = self.create_domains("130.67.0.0/20", "2001::/32", "2001::1/128") |
| 131 | self.assertEqual(len(domains), no_domains) |
| 132 | |
| 133 | d = [] |
| 134 | cursor = 0 |
| 135 | |
| 136 | # Invalid cursor |
| 137 | with self.vapi.assert_negative_api_retval(): |
| 138 | rv, _ = self.vapi.map_domains_get(cursor=no_domains + 10) |
| 139 | self.assertEqual(rv.retval, -7) |
| 140 | |
| 141 | # Delete a domain in the middle of walk |
| 142 | with self.vapi.assert_negative_api_retval(): |
| 143 | rv, _ = self.vapi.map_domains_get(cursor=0) |
| 144 | self.assertEqual(rv.retval, -165) |
| 145 | self.vapi.map_del_domain(index=rv.cursor) |
| 146 | domains.remove(rv.cursor) |
| 147 | |
| 148 | # Continue at point of deleted cursor |
| 149 | try: |
| 150 | rv, _ = self.vapi.map_domains_get(cursor=rv.cursor) |
| 151 | except UnexpectedApiReturnValueError as e: |
| 152 | rv, _ = e.reply |
| 153 | self.assertIn(rv.retval, [0, -165]) |
| 154 | |
| 155 | with self.vapi.assert_known_api_retval([0, -165]): |
| 156 | d = list(self.vapi.vpp.details_iter(self.vapi.map_domains_get)) |
| 157 | self.assertEqual(len(d), no_domains - 1) |
| 158 | |
| 159 | # Clean up |
| 160 | for i in domains: |
| 161 | self.vapi.map_del_domain(index=i) |
| 162 | |
| 163 | def test_map_e_udp(self): |
| 164 | """MAP-E UDP""" |
nothing calls this directly
no test coverage detected