UWNetworksLab / netcov

NetCov: test coverage for network configurations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception when using IPs in `traceroute` headercontraints

rickdonato opened this issue · comments

I'm getting an exception when using IPs in traceroute headercontraints...

>>> bf.q.traceroute(startLocation='nxos-core1', headers=HeaderConstraints(srcIps='10.1.2.1', dstIps='1.1.1.1'),maxTraces=1).answer().frame()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/pybatfish/question/question.py", line 192, in answer
    return _bf_answer_obj(
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/pybatfish/client/internal.py", line 66, in _bf_answer_obj
    return session.get_answer(question_name, snapshot, reference_snapshot)
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/netcov/hook.py", line 42, in get_answer
    self.cov.collect_trace(answer)
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/netcov/coverage.py", line 92, in collect_trace
    self.trace.update(convert_traceroute_traces([answer.frame()]))
  File "/home/rick/development/tech-sessions/2022-11-netcov/.venv/lib/python3.8/site-packages/netcov/algorithm/converttrace.py", line 30, in convert_traceroute_traces
    action_stats[path[-1][-1]] += 1
  File "<attrs generated hash pybatfish.datamodel.flow.Step>", line 2, in __hash__
    return hash((
  File "<attrs generated hash pybatfish.datamodel.flow.RoutingStepDetail>", line 2, in __hash__
    return hash((
TypeError: unhashable type: 'list'

@rickdonato - This looks like some invalid assumption in how NetCov is parsing TR data. It'll help if you can provide a repro - the snapshot used and any relevant setup before you ran the TR query above.