revert loss pack to using floats in all related places
This commit is contained in:
		
							parent
							
								
									02d9418808
								
							
						
					
					
						commit
						ae5d718737
					
				
					 5 changed files with 7 additions and 7 deletions
				
			
		|  | @ -459,7 +459,7 @@ class CoreNetwork(CoreNetworkBase): | ||||||
|         netem = ["netem"] |         netem = ["netem"] | ||||||
|         changed = max(changed, netif.setparam("delay", delay)) |         changed = max(changed, netif.setparam("delay", delay)) | ||||||
|         if loss is not None: |         if loss is not None: | ||||||
|             loss = int(loss) |             loss = float(loss) | ||||||
|         changed = max(changed, netif.setparam("loss", loss)) |         changed = max(changed, netif.setparam("loss", loss)) | ||||||
|         if duplicate is not None: |         if duplicate is not None: | ||||||
|             duplicate = int(duplicate) |             duplicate = int(duplicate) | ||||||
|  |  | ||||||
|  | @ -225,7 +225,7 @@ class OvsNet(CoreNetworkBase): | ||||||
|         delay_changed = netif.setparam("delay", delay) |         delay_changed = netif.setparam("delay", delay) | ||||||
| 
 | 
 | ||||||
|         if loss is not None: |         if loss is not None: | ||||||
|             loss = int(loss) |             loss = float(loss) | ||||||
|         loss_changed = netif.setparam("loss", loss) |         loss_changed = netif.setparam("loss", loss) | ||||||
| 
 | 
 | ||||||
|         if duplicate is not None: |         if duplicate is not None: | ||||||
|  |  | ||||||
|  | @ -782,7 +782,7 @@ class CoreXmlReader(object): | ||||||
|                 link_options.mburst = get_int(options_element, "mburst") |                 link_options.mburst = get_int(options_element, "mburst") | ||||||
|                 link_options.jitter = get_int(options_element, "jitter") |                 link_options.jitter = get_int(options_element, "jitter") | ||||||
|                 link_options.key = get_int(options_element, "key") |                 link_options.key = get_int(options_element, "key") | ||||||
|                 link_options.per = get_int(options_element, "per") |                 link_options.per = get_float(options_element, "per") | ||||||
|                 link_options.unidirectional = get_int(options_element, "unidirectional") |                 link_options.unidirectional = get_int(options_element, "unidirectional") | ||||||
|                 link_options.session = options_element.get("session") |                 link_options.session = options_element.get("session") | ||||||
|                 link_options.emulation_id = get_int(options_element, "emulation_id") |                 link_options.emulation_id = get_int(options_element, "emulation_id") | ||||||
|  |  | ||||||
|  | @ -791,7 +791,7 @@ message LinkOptions { | ||||||
|     int32 key = 3; |     int32 key = 3; | ||||||
|     int32 mburst = 4; |     int32 mburst = 4; | ||||||
|     int32 mer = 5; |     int32 mer = 5; | ||||||
|     int32 per = 6; |     float per = 6; | ||||||
|     int64 bandwidth = 7; |     int64 bandwidth = 7; | ||||||
|     int32 burst = 8; |     int32 burst = 8; | ||||||
|     int64 delay = 9; |     int64 delay = 9; | ||||||
|  |  | ||||||
|  | @ -350,7 +350,7 @@ class TestXml: | ||||||
| 
 | 
 | ||||||
|         # create link |         # create link | ||||||
|         link_options = LinkOptions() |         link_options = LinkOptions() | ||||||
|         link_options.per = 20 |         link_options.per = 10.5 | ||||||
|         link_options.bandwidth = 50000 |         link_options.bandwidth = 50000 | ||||||
|         link_options.jitter = 10 |         link_options.jitter = 10 | ||||||
|         link_options.delay = 30 |         link_options.delay = 30 | ||||||
|  | @ -415,7 +415,7 @@ class TestXml: | ||||||
| 
 | 
 | ||||||
|         # create link |         # create link | ||||||
|         link_options = LinkOptions() |         link_options = LinkOptions() | ||||||
|         link_options.per = 20 |         link_options.per = 10.5 | ||||||
|         link_options.bandwidth = 50000 |         link_options.bandwidth = 50000 | ||||||
|         link_options.jitter = 10 |         link_options.jitter = 10 | ||||||
|         link_options.delay = 30 |         link_options.delay = 30 | ||||||
|  | @ -483,7 +483,7 @@ class TestXml: | ||||||
|         link_options_one.unidirectional = 1 |         link_options_one.unidirectional = 1 | ||||||
|         link_options_one.bandwidth = 5000 |         link_options_one.bandwidth = 5000 | ||||||
|         link_options_one.delay = 10 |         link_options_one.delay = 10 | ||||||
|         link_options_one.per = 5 |         link_options_one.per = 10.5 | ||||||
|         link_options_one.dup = 5 |         link_options_one.dup = 5 | ||||||
|         link_options_one.jitter = 5 |         link_options_one.jitter = 5 | ||||||
|         session.add_link(node_one.id, node_two.id, interface_one, interface_two, link_options_one) |         session.add_link(node_one.id, node_two.id, interface_one, interface_two, link_options_one) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue