/system/extras/tests/net_test/ |
D | srcaddr_selection_test.py | 54 def SetIPv6Sysctl(self, ifname, sysctl, value): argument 55 self.SetSysctl("/proc/sys/net/ipv6/conf/%s/%s" % (ifname, sysctl), value) 57 def SetDAD(self, ifname, value): argument 58 self.SetSysctl("/proc/sys/net/ipv6/conf/%s/accept_dad" % ifname, value) 59 self.SetSysctl("/proc/sys/net/ipv6/conf/%s/dad_transmits" % ifname, value) 61 def SetOptimisticDAD(self, ifname, value): argument 62 self.SetSysctl("/proc/sys/net/ipv6/conf/%s/optimistic_dad" % ifname, value) 64 def SetUseTempaddrs(self, ifname, value): argument 65 self.SetSysctl("/proc/sys/net/ipv6/conf/%s/use_tempaddr" % ifname, value) 67 def SetUseOptimistic(self, ifname, value): argument [all …]
|
D | neighbour_test.py | 66 def setUp(self): argument 67 super(NeighbourTest, self).setUp() 69 for netid in self.tuns: 72 addr = self._RouterAddress(netid, 6) 73 ifindex = self.ifindices[netid] 74 self.iproute.UpdateNeighbour(6, addr, None, ifindex, NUD_FAILED) 77 self.SendRA(netid, 78 retranstimer=self.RETRANS_TIME_MS, 79 reachabletime=self.REACHABLE_TIME_MS) 81 self.sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE) [all …]
|
D | sock_diag_test.py | 55 def assertSocketClosed(self, sock): argument 56 self.assertRaisesErrno(ENOTCONN, sock.getpeername) 58 def assertSocketConnected(self, sock): argument 61 def assertSocketsClosed(self, socketpair): argument 63 self.assertSocketClosed(sock) 65 def setUp(self): argument 66 super(SockDiagBaseTest, self).setUp() 67 self.sock_diag = sock_diag.SockDiag() 68 self.socketpairs = {} 70 def tearDown(self): argument [all …]
|
D | multinetwork_test.py | 94 def CheckPingPacket(self, version, netid, routing_mode, dstaddr, packet): argument 95 s = self.BuildSocket(version, net_test.PingSocket, netid, routing_mode) 97 myaddr = self.MyAddress(version, netid) 104 version, desc, self.GetInterfaceName(netid)) 108 self.ExpectPacketOn(netid, msg, expected) 110 def CheckTCPSYNPacket(self, version, netid, routing_mode, dstaddr): argument 111 s = self.BuildSocket(version, net_test.TCPSocket, netid, routing_mode) 115 myaddr = self.MyAddress(version, netid) 120 self.assertRaisesErrno(errno.EINPROGRESS, s.connect, (dstaddr, 53)) 122 version, desc, self.GetInterfaceName(netid)) [all …]
|
D | ping6_test.py | 50 def __init__(self, tun, mymac, routermac): argument 51 super(PingReplyThread, self).__init__() 52 self._tun = tun 53 self._stopped = False 54 self._mymac = mymac 55 self._routermac = routermac 57 def Stop(self): argument 58 self._stopped = True 60 def ChecksumValid(self, packet): argument 94 def SendTimeExceeded(self, version, packet): argument [all …]
|
D | cstruct.py | 104 def _SetValues(self, values): argument 105 super(CStruct, self).__setattr__("_values", list(values)) 107 def _Parse(self, data): argument 108 data = data[:self._length] 109 values = list(struct.unpack(self._format, data)) 111 if isinstance(value, str) and index in self._nested: 112 values[index] = self._nested[index](value) 113 self._SetValues(values) 115 def __init__(self, values): argument 118 if len(values) < self._length: [all …]
|
D | iproute.py | 213 def _NlAttrIPAddress(self, nla_type, family, address): argument 214 return self._NlAttr(nla_type, socket.inet_pton(family, address)) 216 def _NlAttrInterfaceName(self, nla_type, interface): argument 217 return self._NlAttr(nla_type, interface + "\x00") 219 def _GetConstantName(self, value, prefix): argument 220 return super(IPRoute, self)._GetConstantName(__name__, value, prefix) 222 def _Decode(self, command, msg, nla_type, nla_data): argument 252 name = self._GetConstantName(nla_type, "RTAX_") 254 name = self._GetConstantName(nla_type, "IFA_") 256 name = self._GetConstantName(nla_type, "IFLA_") [all …]
|
D | netlink.py | 65 def _Debug(self, s): argument 66 if self.DEBUG: 69 def _NlAttr(self, nla_type, data): argument 76 def _NlAttrU32(self, nla_type, value): argument 77 return self._NlAttr(nla_type, struct.pack("=I", value)) 79 def _GetConstantName(self, module, value, prefix): argument 90 def _Decode(self, command, msg, nla_type, nla_data): argument 94 def _ParseAttributes(self, command, family, msg, data): argument 123 nla_name, nla_data = self._Decode(command, msg, nla.nla_type, nla_data) 131 self._Debug(" %s" % str((nla_name, nla_data))) [all …]
|
D | tcp_test.py | 43 def tearDown(self): argument 44 if hasattr(self, "s"): 45 self.s.close() 46 super(TcpBaseTest, self).tearDown() 48 def OpenListenSocket(self, version, netid): argument 49 self.port = packets.RandomPort() 54 s.bind((address, self.port)) 56 self.SelectInterface(s, netid, "mark") 60 def _ReceiveAndExpectResponse(self, netid, packet, reply, msg): argument 61 pkt = super(TcpBaseTest, self)._ReceiveAndExpectResponse(netid, packet, [all …]
|
D | anycast_test.py | 43 def __init__(self, fd): argument 44 super(CloseFileDescriptorThread, self).__init__() 45 self.daemon = True 46 self._fd = fd 47 self.finished = False 49 def run(self): argument 52 self._fd.close() 54 self.finished = True 69 def AnycastSetsockopt(self, s, is_add, netid, addr): argument 70 ifindex = self.ifindices[netid] [all …]
|
D | forwarding_test.py | 33 def ForwardBetweenInterfaces(self, enabled, iface1, iface2): argument 35 self.iproute.IifRule(6, enabled, self.GetInterfaceName(iif), 36 self._TableForNetid(oif), self.PRIORITY_IIF) 38 def setUp(self): argument 39 self.SetSysctl("/proc/sys/net/ipv6/conf/all/forwarding", 1) 41 def tearDown(self): argument 42 self.SetSysctl("/proc/sys/net/ipv6/conf/all/forwarding", 0) 44 def CheckForwardingCrash(self, netid, iface1, iface2): argument 50 self.SetSocketMark(listensocket, netid) 53 remoteaddr = self.GetRemoteAddress(version) [all …]
|
/system/media/camera/docs/ |
D | metadata_model.py | 52 def __init__(self): argument 53 self._parent = None 54 self._name = None 57 def parent(self): argument 58 return self._parent 61 def name(self): argument 62 return self._name 64 def find_all(self, pred): argument 75 if pred(self): 76 yield self [all …]
|
D | metadata_helpers_test.py | 71 def test_enum_calculate_value_string(self): argument 74 self.assertEquals(val, 107 def test_enumerate_with_last(self): argument 111 self.fail("Should not return anything for empty list") 115 self.assertEquals(1, x) 116 self.assertEquals(True, last) 120 self.assertListEqual([(4, False), (5, False), (6, True)], lst) 122 def test_filter_tags(self): argument 158 self.assertEqual(result_text, expected_text) 160 def test_wbr(self): argument [all …]
|
/system/tpm/trunks/generator/ |
D | generator.py | 298 def __init__(self, old_type, new_type): argument 305 self.old_type = old_type 306 self.new_type = new_type 308 def OutputForward(self, out_file, defined_types, typemap): argument 320 self.Output(out_file, defined_types, typemap) 322 def Output(self, out_file, defined_types, typemap): argument 333 if self.new_type in defined_types: 336 if self.old_type not in defined_types: 337 typemap[self.old_type].OutputForward(out_file, defined_types, typemap) 338 out_file.write(self._TYPEDEF % {'old_type': self.old_type, [all …]
|
D | generator_test.py | 32 def testTypedef(self): argument 42 self.assertEqual(out_file.getvalue(), 'typedef int INT;\n') 43 self.assertIn('INT', defined_types) 51 self.assertRegexpMatches(out_file2.getvalue(), output_re) 52 self.assertIn('TYPE2', defined_types) 56 def testTypedefSerialize(self): argument 64 self.assertIn('INT', serialized_types) 65 self.assertIn('INT2', serialized_types) 68 def testConstant(self): argument 76 self.assertRegexpMatches(out_file.getvalue(), output_re) [all …]
|
/system/core/adb/ |
D | test_device.py | 42 def wrapper(self, *args): argument 43 if self.device.get_prop('ro.debuggable') != '1': 46 was_root = self.device.shell(['id', '-un'])[0].strip() == 'root' 48 self.device.root() 49 self.device.wait() 52 func(self, *args) 55 self.device.unroot() 56 self.device.wait() 62 def wrapper(self, *args): argument 63 was_root = self.device.shell(['id', '-un'])[0].strip() == 'root' [all …]
|
/system/connectivity/shill/mobile_operator_db/ |
D | serviceproviders_converter.py | 48 def __init__(self, file_path, out_file_path=None): argument 55 self._file_path = file_path 56 self._out_file_path = out_file_path 58 self._gsm_nodes_no_mccmnc = set() 59 self._gsm_nodes_by_mccmnc = {} 60 self._mcc_mnc_by_mccmnc = {} 64 self._xml_cdma_nodes = 0 65 self._xml_gsm_nodes = 0 66 self._protobuf_mnos_dumped = 0 67 self._protobuf_mvnos_dumped = 0 [all …]
|
/system/connectivity/shill/test-scripts/ |
D | flimflam.py | 125 def __init__(self, bus=None): argument 128 self.bus = bus 130 self.manager = dbus.Interface( 134 def _FindDevice(self, device_type, timeout): argument 148 device_obj = self.FindElementByPropertySubstring('Device', 156 def FindCellularDevice(self, timeout=DEFAULT_CELLULAR_TIMEOUT): argument 157 return self._FindDevice(self.DEVICE_CELLULAR, timeout) 159 def FindWimaxDevice(self, timeout=30): argument 160 return self._FindDevice(self.DEVICE_WIMAX, timeout) 162 def _FindService(self, device_type, timeout): argument [all …]
|
D | routing.py | 45 def __init__(self, iface, dest, gway, flags, mask): argument 46 self.interface = iface 47 self.destination = int(dest, 16) 48 self.gateway = int(gway, 16) 49 self.flagbits = int(flags, 16) 50 self.netmask = int(mask, 16) 52 def __str__(self): argument 54 if self.flagbits & RTF_UP: 56 if self.flagbits & RTF_GATEWAY: 58 if self.flagbits & RTF_HOST: [all …]
|
D | stability | 48 def __init__(self, argument 53 self._scheduler = scheduler 54 self._total_duration = total_duration 55 self._test_interval = test_interval 56 self._test_function = test_function 57 self._start = self._scheduler.timefunc() 58 self._finish = self._start + self._total_duration 60 def Run(self): argument 61 for start_one in fxrange(self._start, 62 self._finish, [all …]
|
/system/bt/vendor_libs/test_vendor_lib/scripts/ |
D | test_channel.py | 66 def __init__(self, port): argument 67 self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 68 self._socket.connect(('localhost', port)) 70 def close(self): argument 71 self._socket.close() 73 def send(self, data): argument 74 self._socket.sendall(data) 84 def __init__(self, port): argument 85 self._connection = Connection(port) 86 self._discovered_devices = DeviceManager() [all …]
|
/system/extras/simpleperf/runtest/ |
D | runtest.py | 36 def __init__(self, name): argument 37 self.name = name 38 self.children = [] 40 def add_child(self, child): argument 41 self.children.append(child) 43 def __str__(self): argument 44 return 'CallTreeNode:\n' + '\n'.join(self._dump(1)) 46 def _dump(self, indent): argument 48 strs = [indent_str + self.name] 49 for child in self.children: [all …]
|
/system/extras/tests/sdcard/ |
D | plot_sdcard.py | 50 def __init__(self, line): argument 53 self.time = [] 54 self.data = [] 55 self.name = res.group(1) 56 self.duration = float(res.group(2)) 57 self.iteration = int(res.group(3)) 58 self.summary = re.match('([a-z_]+)_total', self.name) 60 def __repr__(self): argument 61 return str(zip(self.time, self.data)) 63 def Add(self, time, value): argument [all …]
|
/system/extras/pagecache/ |
D | pagecache.py | 20 def __init__(self, inode_to_filename): argument 21 self._inode_to_filename = inode_to_filename 22 self._file_size = {} 23 self._file_pages = {} 24 self._total_pages_added = 0 25 self._total_pages_removed = 0 27 def add_page(self, device_number, inode, offset): argument 29 if (device_number, inode) in self._inode_to_filename: 30 filename, filesize = self._inode_to_filename[(device_number, inode)] 31 if filename not in self._file_pages: [all …]
|
/system/sepolicy/tools/ |
D | insertkeys.py | 19 def __init__(self, path): argument 29 self._base64Key = list() 30 self._base16Key = list() 66 self._base64Key.append(base64Key) 69 self._base16Key.append(base64.b16encode(base64.b64decode(base64Key)).lower()) 98 def __len__(self): argument 99 return len(self._base16Key) 101 def __str__(self): argument 102 return str(self.getBase16Keys()) 104 def getBase16Keys(self): argument [all …]
|