Add apf_ram_at_least decorator to restrict multi-device tests to the given minimum apf ram size capable device.
Test: TH Change-Id: I1042fd0662695e9bc71833eb24311f4436b2676c
This commit is contained in:
parent
ceefdceafd
commit
8f712c6ed9
1 changed files with 18 additions and 0 deletions
|
|
@ -447,6 +447,24 @@ def at_least_B():
|
|||
return wrapper
|
||||
return decorator
|
||||
|
||||
def apf_ram_at_least(size):
|
||||
def decorator(test_function):
|
||||
@functools.wraps(test_function)
|
||||
def wrapper(self, *args, **kwargs):
|
||||
asserts.abort_class_if(
|
||||
(not hasattr(self, 'clientDevice')) or (not hasattr(self, 'client_iface_name')),
|
||||
"no valid client attribute"
|
||||
)
|
||||
|
||||
caps = get_apf_capabilities(self.clientDevice, self.client_iface_name)
|
||||
asserts.skip_if(
|
||||
caps.apf_ram_size < size,
|
||||
f'APF rame size {caps.apf_ram_size} < {size}'
|
||||
)
|
||||
return test_function(self, *args, **kwargs)
|
||||
return wrapper
|
||||
return decorator
|
||||
|
||||
class AdbOutputHandler:
|
||||
def __init__(self, ad, cmd):
|
||||
self._ad = ad
|
||||
|
|
|
|||
Loading…
Reference in a new issue