Module Import alias ImportFrom alias ImportFrom alias Assign NameStore Str Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore BinOpMod Str Dict Str Str NameLoad NameLoad Assign NameStore BinOpMod Str Dict Str Str NameLoad NameLoad ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore Num Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore Num Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr BinOpMult BinOpPow AttributeLoad NameLoad attr Num Num AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr BinOpPow AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad TupleLoad Num Num TupleLoad Num Num For TupleStore NameStore NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad TupleLoad Num Num TupleLoad Num Num TupleLoad Num Num TupleLoad Num Num TupleLoad Num Num For TupleStore NameStore NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad TupleLoad Num Num TupleLoad Num Num TupleLoad Num Num TupleLoad Num Num TupleLoad Num Num For TupleStore NameStore NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr Str attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str Str Str NameLoad Str Str Str AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Call AttributeLoad NameLoad attr ListLoad Str Str Str Str NameLoad Str keyword NameLoad keyword NameLoad keyword NameLoad keyword ListLoad Num Call AttributeLoad NameLoad attr ListLoad Str Str Str Str NameLoad Str Str AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Call AttributeLoad NameLoad attr ListLoad Str Str Str Str NameLoad Str AttributeLoad NameLoad attr Str Str Str Str Str Str Str AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Str keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str Str Str NameLoad Str Str Str AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str Str Str NameLoad Str keyword NameLoad keyword NameLoad keyword NameLoad keyword ListLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Str Str Str NameLoad Str keyword NameLoad keyword NameLoad keyword NameLoad keyword ListLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpMult NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpMult NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num Expr Call AttributeLoad NameLoad attr Num NameLoad decorator_list decorator_list
N/A N/A mock neutron.agent.linux tc_lib neutron.tests base N/A DEVICE_NAME tap_device N/A KERNEL_HZ_VALUE 1000 N/A BW_LIMIT 2000 N/A BURST 100 N/A LATENCY 50 N/A TC_QDISC_OUTPUT N/A qdisc tbf 8011: root refcnt 2 rate %(bw)skbit burst %(burst)skbit lat 50.0ms 
 N/A bw burst BW_LIMIT BURST N/A TC_FILTERS_OUTPUT N/A filter protocol all pref 49152 u32 
filter protocol all pref 49152 u32 fh 800: ht divisor 1 
filter protocol all pref 49152 u32 fh 800::800 order 2048 key ht 800 
  match 00000000/00000000 at 0
  police 0x1e rate %(bw)skbit burst %(burst)skbit mtu 2Kb action 
drop overhead 0b 
  ref 1 bind 1 N/A bw burst BW_LIMIT BURST BaseUnitConversionTest N/A object N/A test_convert_to_kilobits_bare_value N/A N/A self N/A N/A N/A value 1000 N/A expected_value 8 N/A N/A N/A self assertEqual expected_value N/A N/A tc_lib convert_to_kilobits value N/A self base_unit N/A test_convert_to_kilobits_bytes_value N/A N/A self N/A N/A N/A value 1000b N/A expected_value 8 N/A N/A N/A self assertEqual expected_value N/A N/A tc_lib convert_to_kilobits value N/A self base_unit N/A test_convert_to_kilobits_bits_value N/A N/A self N/A N/A N/A value 1000bit N/A expected_value N/A N/A tc_lib bits_to_kilobits 1000 N/A self base_unit N/A N/A N/A self assertEqual expected_value N/A N/A tc_lib convert_to_kilobits value N/A self base_unit N/A test_convert_to_kilobits_megabytes_value N/A N/A self N/A N/A N/A value 1m N/A expected_value N/A N/A tc_lib bits_to_kilobits N/A N/A N/A self base_unit 2 8 N/A self base_unit N/A N/A N/A self assertEqual expected_value N/A N/A tc_lib convert_to_kilobits value N/A self base_unit N/A test_convert_to_kilobits_megabits_value N/A N/A self N/A N/A N/A value 1mbit N/A expected_value N/A N/A tc_lib bits_to_kilobits N/A N/A self base_unit 2 N/A self base_unit N/A N/A N/A self assertEqual expected_value N/A N/A tc_lib convert_to_kilobits value N/A self base_unit N/A test_convert_to_bytes_wrong_unit N/A N/A self N/A N/A N/A value 1Zbit N/A N/A N/A self assertRaises N/A tc_lib InvalidUnit N/A tc_lib convert_to_kilobits value N/A self base_unit N/A test_bytes_to_bits N/A N/A self N/A N/A N/A test_values N/A N/A 0 0 N/A 1 8 N/A N/A input_bytes expected_bits test_values N/A N/A N/A N/A self assertEqual expected_bits N/A N/A tc_lib bytes_to_bits input_bytes N/A N/A TestSIUnitConversions N/A BaseUnitConversionTest N/A base BaseTestCase N/A N/A base_unit N/A tc_lib SI_BASE test_bits_to_kilobits N/A N/A self N/A N/A N/A test_values N/A N/A 0 0 N/A 1 1 N/A 999 1 N/A 1000 1 N/A 1001 2 N/A N/A input_bits expected_kilobits test_values N/A N/A N/A N/A self assertEqual expected_kilobits N/A N/A tc_lib bits_to_kilobits input_bits N/A self base_unit N/A N/A TestIECUnitConversions N/A BaseUnitConversionTest N/A base BaseTestCase N/A N/A base_unit N/A tc_lib IEC_BASE test_bits_to_kilobits N/A N/A self N/A N/A N/A test_values N/A N/A 0 0 N/A 1 1 N/A 1023 1 N/A 1024 1 N/A 1025 2 N/A N/A input_bits expected_kilobits test_values N/A N/A N/A N/A self assertEqual expected_kilobits N/A N/A tc_lib bits_to_kilobits input_bits N/A self base_unit N/A N/A TestTcCommand N/A N/A base BaseTestCase N/A setUp N/A N/A self N/A N/A N/A N/A N/A N/A super TestTcCommand self setUp N/A N/A self tc N/A N/A tc_lib TcCommand DEVICE_NAME KERNEL_HZ_VALUE N/A N/A self bw_limit N/A %s%s N/A BW_LIMIT N/A tc_lib BW_LIMIT_UNIT N/A N/A self burst N/A %s%s N/A BURST N/A tc_lib BURST_UNIT N/A N/A self latency N/A %s%s N/A LATENCY N/A tc_lib LATENCY_UNIT N/A N/A self execute N/A N/A N/A N/A mock patch neutron.agent.common.utils.execute start N/A test_check_kernel_hz_lower_then_zero N/A N/A self N/A N/A N/A N/A N/A self assertRaises N/A tc_lib InvalidKernelHzValue N/A tc_lib TcCommand DEVICE_NAME 0 N/A N/A N/A self assertRaises N/A tc_lib InvalidKernelHzValue N/A tc_lib TcCommand DEVICE_NAME -100 N/A test_get_filters_bw_limits N/A N/A self N/A N/A N/A N/A N/A self execute return_value TC_FILTERS_OUTPUT N/A N/A bw_limit burst_limit N/A N/A N/A self tc get_filters_bw_limits N/A N/A N/A self assertEqual BW_LIMIT bw_limit N/A N/A N/A self assertEqual BURST burst_limit N/A test_get_filters_bw_limits_when_output_not_match N/A N/A self N/A N/A N/A output Some different output from command:tc filters show dev XXX parent ffff: N/A N/A N/A self execute return_value output N/A N/A bw_limit burst_limit N/A N/A N/A self tc get_filters_bw_limits N/A N/A N/A self assertIsNone bw_limit N/A N/A N/A self assertIsNone burst_limit N/A test_get_filters_bw_limits_when_wrong_units N/A N/A self N/A N/A N/A output N/A N/A TC_FILTERS_OUTPUT replace kbit Xbit N/A N/A N/A self execute return_value output N/A N/A N/A self assertRaises N/A tc_lib InvalidUnit N/A N/A self tc get_filters_bw_limits N/A test_get_tbf_bw_limits N/A N/A self N/A N/A N/A N/A N/A self execute return_value TC_QDISC_OUTPUT N/A N/A bw_limit burst_limit N/A N/A N/A self tc get_tbf_bw_limits N/A N/A N/A self assertEqual BW_LIMIT bw_limit N/A N/A N/A self assertEqual BURST burst_limit N/A test_get_tbf_bw_limits_when_wrong_qdisc N/A N/A self N/A N/A N/A output N/A N/A TC_QDISC_OUTPUT replace tbf different_qdisc N/A N/A N/A self execute return_value output N/A N/A bw_limit burst_limit N/A N/A N/A self tc get_tbf_bw_limits N/A N/A N/A self assertIsNone bw_limit N/A N/A N/A self assertIsNone burst_limit N/A test_get_tbf_bw_limits_when_wrong_units N/A N/A self N/A N/A N/A output N/A N/A TC_QDISC_OUTPUT replace kbit Xbit N/A N/A N/A self execute return_value output N/A N/A N/A self assertRaises N/A tc_lib InvalidUnit N/A N/A self tc get_tbf_bw_limits N/A test_set_tbf_bw_limit N/A N/A self N/A N/A N/A N/A N/A N/A self tc set_tbf_bw_limit BW_LIMIT BURST LATENCY N/A N/A N/A N/A self execute assert_called_once_with N/A tc qdisc replace dev DEVICE_NAME root tbf rate N/A self bw_limit latency N/A self latency burst N/A self burst run_as_root True check_exit_code True log_fail_as_error True extra_ok_codes None N/A test_update_filters_bw_limit N/A N/A self N/A N/A N/A N/A N/A N/A self tc update_filters_bw_limit BW_LIMIT BURST N/A N/A N/A N/A self execute assert_has_calls N/A N/A N/A mock call N/A tc qdisc del dev DEVICE_NAME ingress run_as_root True check_exit_code True log_fail_as_error True extra_ok_codes N/A 2 N/A N/A mock call N/A tc qdisc add dev DEVICE_NAME ingress handle N/A tc_lib INGRESS_QDISC_ID run_as_root True check_exit_code True log_fail_as_error True extra_ok_codes None N/A N/A mock call N/A tc filter add dev DEVICE_NAME parent N/A tc_lib INGRESS_QDISC_ID protocol all prio 49 basic police rate N/A self bw_limit burst N/A self burst mtu N/A tc_lib MAX_MTU_VALUE drop run_as_root True check_exit_code True log_fail_as_error True extra_ok_codes None N/A test_update_tbf_bw_limit N/A N/A self N/A N/A N/A N/A N/A N/A self tc update_tbf_bw_limit BW_LIMIT BURST LATENCY N/A N/A N/A N/A self execute assert_called_once_with N/A tc qdisc replace dev DEVICE_NAME root tbf rate N/A self bw_limit latency N/A self latency burst N/A self burst run_as_root True check_exit_code True log_fail_as_error True extra_ok_codes None N/A test_delete_filters_bw_limit N/A N/A self N/A N/A N/A N/A N/A N/A self tc delete_filters_bw_limit N/A N/A N/A N/A self execute assert_called_once_with N/A tc qdisc del dev DEVICE_NAME ingress run_as_root True check_exit_code True log_fail_as_error True extra_ok_codes N/A 2 N/A test_delete_tbf_bw_limit N/A N/A self N/A N/A N/A N/A N/A N/A self tc delete_tbf_bw_limit N/A N/A N/A N/A self execute assert_called_once_with N/A tc qdisc del dev DEVICE_NAME root run_as_root True check_exit_code True log_fail_as_error True extra_ok_codes N/A 2 N/A test__get_filters_burst_value_burst_not_none N/A N/A self N/A N/A N/A N/A N/A self assertEqual BURST N/A N/A N/A self tc _get_filters_burst_value BW_LIMIT BURST N/A test__get_filters_burst_no_burst_value_given N/A N/A self N/A N/A N/A expected_burst N/A BW_LIMIT 0.8 N/A N/A N/A self assertEqual expected_burst N/A N/A N/A self tc _get_filters_burst_value BW_LIMIT None N/A test__get_filters_burst_burst_value_zero N/A N/A self N/A N/A N/A expected_burst N/A BW_LIMIT 0.8 N/A N/A N/A self assertEqual expected_burst N/A N/A N/A self tc _get_filters_burst_value BW_LIMIT 0 N/A test__get_tbf_burst_value_when_burst_bigger_then_minimal N/A N/A self N/A N/A N/A result N/A N/A N/A self tc _get_tbf_burst_value BW_LIMIT BURST N/A N/A N/A self assertEqual BURST result N/A test__get_tbf_burst_value_when_burst_smaller_then_minimal N/A N/A self N/A N/A N/A result N/A N/A N/A self tc _get_tbf_burst_value BW_LIMIT 0 N/A N/A N/A self assertEqual 2 result N/A N/A