Weird UBIFS error to cause connmand crashed in UBIFS volume root
by JH
Hi,
I have been playing kernel mont to UBIFS rootfs volume for several
days, the kernel can now mount to UBIFS volume root, the system
services were running fine except the connection manager connmand
service failed, I restarted it again and again, the connman was always
crashed and ubifs_read_node: bad node type. Despite the UBIFS errors,
the system could be still running, I could type shell comands in
console when connman was stopped.
I am not clear if UBIFS errors caused connman failure or connman
caused UBIFS error, and why it always failed in connman, was it
coincident or was some special in connman man link to other things
such as udev to cause the issues?
Let me make it clear, it did not happen when the UBIFS rootfs was not
in UBIFS volume, so something was not right in UBIFS volume mounted
root, what could that be?
# ps
PID USER VSZ STAT COMMAND
1 root 5896 S {systemd} /sbin/init
2 root 0 SW [kthreadd]
3 root 0 IW< [rcu_gp]
4 root 0 IW< [rcu_par_gp]
5 root 0 IW [kworker/0:0-cgr]
6 root 0 IW< [kworker/0:0H]
7 root 0 IW [kworker/u2:0-ev]
8 root 0 IW< [mm_percpu_wq]
9 root 0 SW [ksoftirqd/0]
10 root 0 IW [rcu_sched]
11 root 0 IW [rcu_bh]
12 root 0 SW [migration/0]
13 root 0 SW [cpuhp/0]
14 root 0 SW [kdevtmpfs]
16 root 0 SW [oom_reaper]
17 root 0 IW< [writeback]
18 root 0 SW [kcompactd0]
19 root 0 IW< [crypto]
20 root 0 IW< [kblockd]
21 root 0 IW< [ata_sff]
22 root 0 SW [watchdogd]
23 root 0 IW< [rpciod]
24 root 0 IW< [kworker/u3:0-MW]
25 root 0 IW< [xprtiod]
26 root 0 IW< [cfg80211]
27 root 0 SW [kswapd0]
28 root 0 IW< [nfsiod]
57 root 0 IW< [ci_otg]
58 root 0 IW [kworker/u2:1-ev]
59 root 0 SW [irq/48-mmc0]
60 root 0 IW< [ipv6_addrconf]
61 root 0 SW [irq/18-imx_ther]
62 root 0 IW [kworker/0:2-eve]
63 root 0 SW [ubi_bgt0d]
68 root 0 SW [ubifs_bgt0_2]
83 root 12476 S /lib/systemd/systemd-journald
93 root 12476 S /lib/systemd/systemd-udevd
99 systemd- 4672 S /lib/systemd/systemd-networkd
104 systemd- 4708 S /lib/systemd/systemd-timesyncd
125 root 0 IW< [MWIFIEX_WORK_QU]
126 root 0 IW< [kworker/u3:1-MW]
129 root 0 IW< [MWIFIEX_DFS_CAC]
130 root 0 IW< [MWIFIEX_DFS_CHS]
139 root 4336 S /lib/systemd/systemd-logind
140 root 5592 S /usr/sbin/ofonod -n
141 messageb 3904 S /usr/bin/dbus-daemon --system --address=systemd: --noy
143 root 3548 S /sbin/agetty -o -p -- \u --noclear tty1 linux
144 root 2476 S -sh
167 root 2476 R ps
Here is the boot log:
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.19.75 (oe-user@oe-host) (gcc version
8.2.0 (GCC)) #1 SMP Sat Feb 15 01:18:31 UTC 2020
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing
instruction cache
[ 0.000000] earlycon: ec_imx6q0 at MMIO 0x02020000 (options '')
[ 0.000000] bootconsole [ec_imx6q0] enabled
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] cma: Reserved 64 MiB at 0x8c000000
[ 0.000000] random: get_random_bytes called from
start_kernel+0x8c/0x48c with crng_init=0
[ 0.000000] percpu: Embedded 18 pages/cpu s41896 r8192 d23640 u73728
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 65024
[ 0.000000] Kernel command line: console=ttymxc0,115200 earlycon
init=/sbin/init mtdparts=gpmi-nand:1m(boot),1m(ubootenv),-(storage)
root=ubi0:rootfs-volume rw ubi.mtd=2,2048 noinitrd rootfstype=ubifs
mem=251
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Memory: 169124K/262144K available (11264K kernel code,
881K rwdata, 3664K rodata, 1024K init, 7648K bss, 27484K reserved,
65536K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xd0800000 - 0xff800000 ( 752 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (12256 kB)
[ 0.000000] .init : 0x(ptrval) - 0x(ptrval) (1024 kB)
[ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 882 kB)
[ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) (7649 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Running RCU self tests
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] rcu: RCU lockdep checking is enabled.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] Switching to timer-based delay loop, resolution 41ns
[ 0.000022] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps
every 89478484971ns
[ 0.007843] clocksource: mxc_timer1: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 79635851949 ns
[ 0.020229] Console: colour dummy device 80x30
[ 0.021912] Lock dependency validator: Copyright (c) 2006 Red Hat,
Inc., Ingo Molnar
[ 0.029959] ... MAX_LOCKDEP_SUBCLASSES: 8
[ 0.033733] ... MAX_LOCK_DEPTH: 48
[ 0.037906] ... MAX_LOCKDEP_KEYS: 8191
[ 0.042364] ... CLASSHASH_SIZE: 4096
[ 0.046605] ... MAX_LOCKDEP_ENTRIES: 32768
[ 0.051044] ... MAX_LOCKDEP_CHAINS: 65536
[ 0.055572] ... CHAINHASH_SIZE: 32768
[ 0.059919] memory used by lock dependency info: 4655 kB
[ 0.065313] per task-struct memory footprint: 1536 bytes
[ 0.070908] Calibrating delay loop (skipped), value calculated
using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.081172] pid_max: default: 32768 minimum: 301
[ 0.086496] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.092439] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.103725] CPU: Testing write buffer coherency: ok
[ 0.108096] /cpus/cpu@0 missing clock-frequency property
[ 0.111306] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.123006] Setting up static identity map for 0x80100000 - 0x80100078
[ 0.128368] rcu: Hierarchical SRCU implementation.
[ 0.137167] smp: Bringing up secondary CPUs ...
[ 0.139124] smp: Brought up 1 node, 1 CPU
[ 0.142921] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.149227] CPU: All CPU(s) started in SVC mode.
[ 0.158935] devtmpfs: initialized
[ 0.201054] VFP support v0.3: implementor 41 architecture 2 part 30
variant 7 rev 5
[ 0.207894] clocksource: jiffies: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.216169] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.228786] pinctrl core: initialized pinctrl subsystem
[ 0.240755] NET: Registered protocol family 16
[ 0.321600] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.334251] cpuidle: using governor menu
[ 0.376285] vdd3p0: supplied by regulator-dummy
[ 0.382733] cpu: supplied by regulator-dummy
[ 0.388666] vddsoc: supplied by regulator-dummy
[ 0.440175] No ATAGs?
[ 0.440749] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4
watchpoint registers.
[ 0.448312] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.466446] imx6ul-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
[ 0.472599] imx6ul-pinctrl 2290000.iomuxc-snvs: no groups defined
in /soc/aips-bus@2200000/iomuxc-snvs@2290000
[ 0.480694] imx6ul-pinctrl 2290000.iomuxc-snvs: initialized IMX
pinctrl driver
[ 0.651549] mxs-dma 1804000.dma-apbh: initialized
[ 0.665095] vgaarb: loaded
[ 0.668171] SCSI subsystem initialized
[ 0.672731] usbcore: registered new interface driver usbfs
[ 0.676417] usbcore: registered new interface driver hub
[ 0.681322] usbcore: registered new device driver usb
[ 0.690091] media: Linux media interface: v0.10
[ 0.692143] videodev: Linux video capture interface: v2.00
[ 0.698605] pps_core: LinuxPPS API ver. 1 registered
[ 0.702277] pps_core: Software ver. 5.3.6 - Copyright 2005-2007
Rodolfo Giometti <giometti(a)linux.it>
[ 0.711747] PTP clock support registered
[ 0.717640] Advanced Linux Sound Architecture Driver Initialized.
[ 0.727718] Bluetooth: Core ver 2.22
[ 0.728788] NET: Registered protocol family 31
[ 0.733166] Bluetooth: HCI device and connection manager initialized
[ 0.739471] Bluetooth: HCI socket layer initialized
[ 0.744378] Bluetooth: L2CAP socket layer initialized
[ 0.749641] Bluetooth: SCO socket layer initialized
[ 0.759423] clocksource: Switched to clocksource mxc_timer1
[ 1.421932] VFS: Disk quotas dquot_6.6.0
[ 1.423496] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 1.509030] NET: Registered protocol family 2
[ 1.515694] tcp_listen_portaddr_hash hash table entries: 128
(order: 0, 5120 bytes)
[ 1.521238] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[ 1.527688] TCP bind hash table entries: 2048 (order: 4, 73728 bytes)
[ 1.534946] TCP: Hash tables configured (established 2048 bind 2048)
[ 1.541719] UDP hash table entries: 256 (order: 2, 20480 bytes)
[ 1.546477] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)
[ 1.554293] NET: Registered protocol family 1
[ 1.562500] RPC: Registered named UNIX socket transport module.
[ 1.565713] RPC: Registered udp transport module.
[ 1.570649] RPC: Registered tcp transport module.
[ 1.575085] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 1.600954] Initialise system trusted keyrings
[ 1.604320] workingset: timestamp_bits=30 max_order=16 bucket_order=0
[ 1.660099] NFS: Registering the id_resolver key type
[ 1.662644] Key type id_resolver registered
[ 1.666574] Key type id_legacy registered
[ 1.671374] jffs2: version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
[ 1.681352] fuse init (API version 7.27)
[ 1.727390] Key type asymmetric registered
[ 1.728913] Asymmetric key parser 'x509' registered
[ 1.735929] io scheduler noop registered
[ 1.737502] io scheduler deadline registered
[ 1.744046] io scheduler cfq registered (default)
[ 1.746464] io scheduler mq-deadline registered
[ 1.751446] io scheduler kyber registered
[ 1.798251] imx-sdma 20ec000.sdma: Direct firmware load for
imx/sdma/sdma-imx6q.bin failed with error -2
[ 1.805647] imx-sdma 20ec000.sdma: external firmware not found,
using ROM firmware
[ 1.825203] console [ttymxc0] enabled
[ 1.829093] bootconsole [ec_imx6q0] disabled
[ 1.842863] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 49,
base_baud = 5000000) is a IMX
[ 1.857338] 21f0000.serial: ttymxc3 at MMIO 0x21f0000 (irq = 50,
base_baud = 5000000) is a IMX
[ 1.972458] brd: module loaded
[ 2.047892] loop: module loaded
[ 2.075735] random: fast init done
[ 2.107514] nand: device found, Manufacturer ID: 0xef, Chip ID: 0xda
[ 2.114253] nand: Winbond W29N02GV
[ 2.117792] nand: 256 MiB, SLC, erase size: 128 KiB, page size:
2048, OOB size: 64
[ 2.132084] Bad block table found at page 131008, version 0x01
[ 2.139165] Bad block table found at page 130944, version 0x01
[ 2.146985] 3 cmdlinepart partitions found on MTD device gpmi-nand
[ 2.153527] Creating 3 MTD partitions on "gpmi-nand":
[ 2.158738] 0x000000000000-0x000000100000 : "boot"
[ 2.175928] 0x000000100000-0x000000200000 : "ubootenv"
[ 2.190584] 0x000000200000-0x000010000000 : "storage"
[ 2.610540] gpmi-nand 1806000.gpmi-nand: driver registered.
[ 2.626095] libphy: Fixed MDIO Bus: probed
[ 2.634294] CAN device driver interface
[ 2.645658] usbcore: registered new interface driver asix
[ 2.651725] usbcore: registered new interface driver ax88179_178a
[ 2.658211] usbcore: registered new interface driver cdc_ether
[ 2.664676] usbcore: registered new interface driver net1080
[ 2.670935] usbcore: registered new interface driver cdc_subset
[ 2.677239] usbcore: registered new interface driver zaurus
[ 2.683554] usbcore: registered new interface driver cdc_ncm
[ 2.689796] usbcore: registered new interface driver qmi_wwan
[ 2.695676] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 2.702495] ehci-pci: EHCI PCI platform driver
[ 2.707340] ehci-mxc: Freescale On-Chip EHCI Host driver
[ 2.715096] usbcore: registered new interface driver cdc_wdm
[ 2.721514] usbcore: registered new interface driver usb-storage
[ 3.025342] imx_usb 2184200.usb: 2184200.usb supply vbus not found,
using dummy regulator
[ 3.034808] imx_usb 2184200.usb: Linked as a consumer to regulator.0
[ 3.047862] ci_hdrc ci_hdrc.1: EHCI Host Controller
[ 3.053703] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
[ 3.089639] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[ 3.105053] hub 1-0:1.0: USB hub found
[ 3.110273] hub 1-0:1.0: 1 port detected
[ 3.131914] input: 20cc000.snvs:snvs-powerkey as
/devices/soc0/soc/2000000.aips-bus/20cc000.snvs/20cc000.snvs:snvs-powerkey/input/input0
[ 3.163646] snvs_rtc 20cc000.snvs:snvs-rtc-lp: rtc core: registered
20cc000.snvs:snvs-rtc-lp as rtc0
[ 3.174375] i2c /dev entries driver
[ 3.196518] imx2-wdt 20bc000.wdog: timeout 60 sec (nowayout=0)
[ 3.205159] Bluetooth: HCI UART driver ver 2.3
[ 3.209993] Bluetooth: HCI UART protocol H4 registered
[ 3.216444] Bluetooth: HCI UART protocol LL registered
[ 3.231214] sdhci: Secure Digital Host Controller Interface driver
[ 3.237540] sdhci: Copyright(c) Pierre Ossman
[ 3.242226] sdhci-pltfm: SDHCI platform and OF driver helper
[ 3.252965] sdhci-esdhc-imx 2190000.usdhc: Linked as a consumer to
regulator.4
[ 3.301035] mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc]
using ADMA
[ 3.324541] usbcore: registered new interface driver usbhid
[ 3.330501] usbhid: USB HID core driver
[ 3.414641] mmc0: new high speed SDIO card at address 0001
[ 3.421809] NET: Registered protocol family 10
[ 3.437740] Segment Routing with IPv6
[ 3.443665] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 3.455252] NET: Registered protocol family 17
[ 3.460195] can: controller area network core (rev 20170425 abi 9)
[ 3.467043] NET: Registered protocol family 29
[ 3.472215] can: raw protocol (rev 20170425)
[ 3.476791] can: broadcast manager protocol (rev 20170425 t)
[ 3.482891] can: netlink gateway (rev 20170425) max_hops=1
[ 3.491187] Key type dns_resolver registered
[ 3.501123] cpu cpu0: Linked as a consumer to regulator.2
[ 3.507419] cpu cpu0: Linked as a consumer to regulator.3
[ 3.518440] cpu cpu0: failed to disable 696MHz OPP
[ 3.528799] Registering SWP/SWPB emulation handler
[ 3.540519] Loading compiled-in X.509 certificates
[ 3.654691] imx_thermal tempmon: Commercial CPU temperature grade -
max:95C critical:90C passive:85C
[ 3.668095] ubi0: default fastmap pool size: 100
[ 3.673065] ubi0: default fastmap WL pool size: 50
[ 3.677913] ubi0: attaching mtd2
[ 5.311751] random: crng init done
[ 5.813115] ubi0: scanning is finished
[ 5.833556] ubi0 warning: ubi_eba_init: cannot reserve enough PEBs
for bad PEB handling, reserved 34, need 36
[ 5.859989] ubi0: attached mtd2 (name "storage", size 254 MiB)
[ 5.865897] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 5.873009] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 5.879943] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 5.886952] ubi0: good PEBs: 2028, bad PEBs: 4, corrupted PEBs: 0
[ 5.893173] ubi0: user volume: 4, internal volumes: 1, max. volumes
count: 128
[ 5.900519] ubi0: max/mean erase counter: 1/0, WL threshold: 4096,
image sequence number: 1303700519
[ 5.909775] ubi0: available PEBs: 0, total reserved PEBs: 2028,
PEBs reserved for bad PEB handling: 34
[ 5.919515] ubi0: background thread "ubi_bgt0d" started, PID 63
[ 5.926731] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock
to 1970-01-01 00:00:02 UTC (2)
[ 5.936237] cfg80211: Loading compiled-in X.509 certificates for
regulatory database
[ 5.953050] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 5.962234] vdd3p0: disabling
[ 5.965442] ALSA device list:
[ 5.968456] No soundcards found.
[ 5.973343] platform regulatory.0: Direct firmware load for
regulatory.db failed with error -2
[ 5.982258] cfg80211: failed to load regulatory.db
[ 5.995617] UBIFS (ubi0:2): background thread "ubifs_bgt0_2" started, PID 68
[ 6.049588] UBIFS (ubi0:2): recovery needed
[ 7.136951] UBIFS (ubi0:2): recovery completed
[ 7.148039] UBIFS (ubi0:2): UBIFS: mounted UBI device 0, volume 2,
name "rootfs-volume"
[ 7.156248] UBIFS (ubi0:2): LEB size: 126976 bytes (124 KiB),
min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 7.166338] UBIFS (ubi0:2): FS size: 214462464 bytes (204 MiB, 1689
LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
[ 7.177159] UBIFS (ubi0:2): reserved for root: 0 bytes (0 KiB)
[ 7.183103] UBIFS (ubi0:2): media format: w4/r0 (latest is w5/r0),
UUID 54AA63BA-6700-4424-A80E-3BBEA92B96D3, small LPT model
[ 7.197196] VFS: Mounted root (ubifs filesystem) on device 0:13.
[ 7.207404] devtmpfs: mounted
[ 7.213752] Freeing unused kernel memory: 1024K
[ 7.219392] Run /sbin/init as init process
[ 7.798118] systemd[1]: System time before build time, advancing clock.
[ 7.959033] systemd[1]: systemd 239 running in system mode. (-PAM
-AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP
-GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2
-IDN)
[ 7.985315] systemd[1]: Detected architecture arm.
Welcome to OpenEmbedded nodistro.0!
[ 8.060104] systemd[1]: Set hostname to <solar>.
[ 8.932602] systemd[1]: File
/lib/systemd/system/systemd-journald.service:36 configures an IP
firewall (IPAddressDeny=any), but the local system does not support
BPF/cgroup based firewalling.
[ 8.951338] systemd[1]: Proceeding WITHOUT firewalling in effect!
(This warning is only shown for the first loaded unit using IP
firewalling.)
[ 9.606602] systemd[1]: Created slice system-getty.slice.
[ OK ] Created slice system-getty.slice.
[ 9.668267] systemd[1]: Listening on Network Service Netlink Socket.
[ OK ] Listening on Network Service Netlink Socket.
[ 9.720231] systemd[1]: Started Forward Password Requests to Wall
Directory Watch.
[ OK ] Started Forward Password Requests to Wall Directory Watch.
[ 9.767083] systemd[1]: Created slice system-serial\x2dgetty.slice.
[ OK ] Created slice system-serial\x2dgetty.slice.
[ 9.828772] systemd[1]: Listening on Journal Socket (/dev/log).
[ OK ] Listening on Journal Socket (/dev/log).
[ OK ] Reached target Swap.
[ OK ] Created slice User and Session Slice.
[ OK ] Listening on udev Control Socket.
[ OK ] Reached target Slices.
[ OK ] Listening on initctl Compatibility Named Pipe.
[ OK ] Listening on Journal Socket.
Mounting Temporary Directory (/tmp)...
Starting Apply Kernel Variables...
Mounting FUSE Control File System...
Mounting Kernel Debug File System...
[ OK ] Reached target Remote File Systems.
Starting Journal Service...
Starting Remount Root and Kernel File Systems...
[ OK ] Started Dispatch Password Requests to Console Directory Watch.
[ OK ] Reached target Paths.
[ OK ] Reached target Host and Network Name Lookups.
[ OK ] Listening on udev Kernel Socket.
Starting udev Coldplug all Devices...
[ OK ] Mounted Temporary Directory (/tmp).
[ OK ] Started Apply Kernel Variables.
[ OK ] Mounted FUSE Control File System.
[ OK ] Mounted Kernel Debug File System.
[ OK ] Started Remount Root and Kernel File Systems.
Starting Create Static Device Nodes in /dev...
[ OK ] Started Create Static Device Nodes in /dev.
[ OK ] Started Journal Service.
Starting Flush Journal to Persistent Storage...
[ OK ] Reached target Local File Systems (Pre).
Mounting /var/volatile...
[ OK ] Reached target Containers.
Starting udev Kernel Device Manager...
[ OK ] Mounted /var/volatile.
Starting Load/Save Random Seed...
[ OK ] Reached target Local File Systems.
[ 12.244931] systemd-journald[83]: Received request to flush runtime
journal from PID 1
[ OK ] Started Load/Save Random Seed.
[ OK ] Started Flush Journal to Persistent Storage.
Starting Create Volatile Files and Directories...
[ OK ] Started Create Volatile Files and Directories.
[ OK ] Started udev Kernel Device Manager.
Starting Network Service...
Starting Update UTMP about System Boot/Shutdown...
Starting Network Time Synchronization...
[ OK ] Started Update UTMP about System Boot/Shutdown.
[ OK ] Started Network Service.
[ OK ] Started Network Time Synchronization.
[ OK ] Reached target System Time Synchronized.
[ OK ] Started udev Coldplug all Devices.
[ OK ] Found device /dev/ttymxc0.
[ 20.260214] mwifiex_sdio mmc0:0001:1: info: FW download over, size
258680 bytes
[ 20.521081] mwifiex_sdio mmc0:0001:1: WLAN FW is active
[ 20.576962] mwifiex_sdio mmc0:0001:1: CMD_RESP: cmd 0x242 error, result=0x2
[ 20.584278] mwifiex_sdio mmc0:0001:1: mwifiex_process_cmdresp: cmd
0x242 failed during initialization
[ 20.720383] mwifiex_sdio mmc0:0001:1: info: MWIFIEX VERSION:
mwifiex 1.0 (14.68.36.p60)
[ 20.728536] mwifiex_sdio mmc0:0001:1: driver_version = mwifiex 1.0
(14.68.36.p60)
[ OK ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
[ OK ] Reached target System Initialization.
[ OK ] Listening on D-Bus System Message Bus Socket.
[ OK ] Started Daily Cleanup of Temporary Directories.
[ OK ] Reached target Timers.
Starting sshd.socket.
Starting Load/Save RF Kill Switch Status...
[ OK ] Listening on sshd.socket.
[ OK ] Started Load/Save RF Kill Switch Status.
[ OK ] Reached target Sockets.
[ OK ] Reached target Basic System.
Starting Login Service...
Starting Telephony service...
[ OK ] Started D-Bus System Message Bus.
Starting Connection service...
[ OK ] Started Getty on tty1.
[ OK ] Started Serial Getty on ttymxc0.
[ 23.510795] UBIFS error (ubi0:2 pid 142): ubifs_read_node: bad node
type (255 but expected 2)
[ 23.520021] UBIFS error (ubi0:2 pid 142): ubifs_read_node: bad node
at LEB 395:118520, LEB mapping status 1
[ 23.529948] Not a node, first 24 bytes:
[ 23.529979] 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff
........................
[ 23.546828] CPU: 0 PID: 142 Comm: (connmand) Not tainted 4.19.75 #1
[ 23.553124] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[ 23.559326] Backtrace:
[ 23.561821] [<c010e548>] (dump_backtrace) from [<c010e8d0>]
(show_stack+0x18/0x1c)
[ 23.569423] r7:00000000 r6:600d0013 r5:00000000 r4:c11cf8d8
[ 23.575119] [<c010e8b8>] (show_stack) from [<c0b79708>]
(dump_stack+0xdc/0x114)
[ 23.582462] [<c0b7962c>] (dump_stack) from [<c0423f30>]
(ubifs_read_node+0x230/0x268)
[ 23.590324] r10:00000002 r9:c69e3400 r8:00000041 r7:0000018b
r6:00000000 r5:0001cef8
[ 23.598178] r4:c6611000 r3:880c3d76
[ 23.601787] [<c0423d00>] (ubifs_read_node) from [<c0440b80>]
(ubifs_tnc_read_node+0xb0/0xb8)
[ 23.610256] r10:c69e3400 r9:c1108908 r8:00000000 r7:c6611000
r6:c69e3400 r5:00000002
[ 23.618106] r4:c6ae75c8
[ 23.620668] [<c0440ad0>] (ubifs_tnc_read_node) from [<c0425948>]
(tnc_read_hashed_node+0xa0/0x1bc)
[ 23.629656] r7:c6611198 r6:c6611000 r5:c69e3400 r4:c6ae75c8
[ 23.635347] [<c04258a8>] (tnc_read_hashed_node) from [<c04271bc>]
(ubifs_tnc_locate.part.2+0x1cc/0x1f4)
[ 23.644764] r7:c6611198 r6:c6a1fd18 r5:00000000 r4:c6611000
[ 23.650454] [<c0426ff0>] (ubifs_tnc_locate.part.2) from
[<c0427998>] (ubifs_tnc_lookup_nm+0x3c/0x150)
[ 23.659701] r10:c6a1fd18 r9:c6a1fcfc r8:c6611000 r7:c69e3400
r6:c47085d0 r5:c1108908
[ 23.667550] r4:c69e3400
[ 23.670114] [<c042795c>] (ubifs_tnc_lookup_nm) from [<c041b2d4>]
(ubifs_lookup+0x114/0x300)
[ 23.678494] r10:0000106e r9:c6611000 r8:c1108908 r7:5e05a400
r6:c47085d0 r5:c49a3450
[ 23.686344] r4:c69e3400
[ 23.688913] [<c041b1c0>] (ubifs_lookup) from [<c0298e5c>]
(path_openat+0x90c/0x1180)
[ 23.696685] r10:c49a3450 r9:c693c8c0 r8:c6a1fe28 r7:00020020
r6:c6a1fee8 r5:c496b730
[ 23.704535] r4:c6a1fdc4
[ 23.707099] [<c0298550>] (path_openat) from [<c029a7a0>]
(do_filp_open+0x78/0xe4)
[ 23.714611] r10:c6ae7200 r9:025cd828 r8:00000001 r7:c1108908
r6:c6a1fee8 r5:c6a1fe28
[ 23.722461] r4:c60e7000
[ 23.725025] [<c029a728>] (do_filp_open) from [<c028eb70>]
(do_open_execat+0x74/0x1a0)
[ 23.732884] r8:ffffff9c r7:00000000 r6:c60e7000 r5:c1108908 r4:c60e7000
[ 23.739615] [<c028eafc>] (do_open_execat) from [<c0290a98>]
(__do_execve_file+0x7ac/0xa2c)
[ 23.747908] r9:025cd828 r8:ffffff9c r7:00000000 r6:c638e400
r5:c1108908 r4:c60e7000
[ 23.755679] [<c02902ec>] (__do_execve_file) from [<c029100c>]
(sys_execve+0x3c/0x44)
[ 23.763451] r10:0000000b r9:c6a1e000 r8:c01011e4 r7:0000000b
r6:025ca1f8 r5:025ac0a8
[ 23.771302] r4:025cd828
[ 23.773865] [<c0290fd0>] (sys_execve) from [<c0101000>]
(ret_fast_syscall+0x0/0x28)
[ 23.781544] Exception stack(0xc6a1ffa8 to 0xc6a1fff0)
[ 23.786625] ffa0: ffffffff 0000003f 025a6b38
025cd828 025ac0a8 025a6c58
[ 23.794829] ffc0: ffffffff 0000003f 025ca1f8 0000000b 025cd828
00000000 00000000 00000001
[ 23.803030] ffe0: 00574934 bea266b4 004b422f b6cfd2f8
[ 23.808106] r5:0000003f r4:ffffffff
[ OK ] Started Login Service.
[FAILED] Failed to start Connection service.
See 'systemctl status connman.service' for details.
[ OK ] Started Telephony service.
[ OK ] Reached target Network.
[ OK ] Stopped Connection service.
Starting Connection service...
[ 24.746053] UBIFS error (ubi0:2 pid 151): ubifs_read_node: bad node
type (255 but expected 2)
[ 24.754919] UBIFS error (ubi0:2 pid 151): ubifs_read_node: bad node
at LEB 395:118520, LEB mapping status 1
[ 24.764914] Not a node, first 24 bytes:
[ 24.764943] 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff
........................
[ 24.781813] CPU: 0 PID: 151 Comm: (connmand) Not tainted 4.19.75 #1
[ 24.788110] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[ 24.794313] Backtrace:
[ 24.796810] [<c010e548>] (dump_backtrace) from [<c010e8d0>]
(show_stack+0x18/0x1c)
[ 24.804412] r7:00000000 r6:600c0113 r5:00000000 r4:c11cf8d8
[ 24.810106] [<c010e8b8>] (show_stack) from [<c0b79708>]
(dump_stack+0xdc/0x114)
[ 24.817450] [<c0b7962c>] (dump_stack) from [<c0423f30>]
(ubifs_read_node+0x230/0x268)
[ 24.825313] r10:00000002 r9:c6858600 r8:00000041 r7:0000018b
r6:00000000 r5:0001cef8
[ 24.833167] r4:c6611000 r3:880c3d76
[ 24.836776] [<c0423d00>] (ubifs_read_node) from [<c0440b80>]
(ubifs_tnc_read_node+0xb0/0xb8)
[ 24.845242] r10:c6858600 r9:c1108908 r8:00000000 r7:c6611000
r6:c6858600 r5:00000002
[ 24.853092] r4:c6ae75c8
[ 24.855657] [<c0440ad0>] (ubifs_tnc_read_node) from [<c0425948>]
(tnc_read_hashed_node+0xa0/0x1bc)
[ 24.864640] r7:c6611198 r6:c6611000 r5:c6858600 r4:c6ae75c8
[ 24.870329] [<c04258a8>] (tnc_read_hashed_node) from [<c04271bc>]
(ubifs_tnc_locate.part.2+0x1cc/0x1f4)
[ 24.879748] r7:c6611198 r6:c6a1fd18 r5:00000000 r4:c6611000
[ 24.885437] [<c0426ff0>] (ubifs_tnc_locate.part.2) from
[<c0427998>] (ubifs_tnc_lookup_nm+0x3c/0x150)
[ 24.894686] r10:c6a1fd18 r9:c6a1fcfc r8:c6611000 r7:c6858600
r6:c47085d0 r5:c1108908
[ 24.902537] r4:c6858600
[ 24.905100] [<c042795c>] (ubifs_tnc_lookup_nm) from [<c041b2d4>]
(ubifs_lookup+0x114/0x300)
[ 24.913480] r10:0000106e r9:c6611000 r8:c1108908 r7:5e05a400
r6:c47085d0 r5:c497e678
[ 24.921332] r4:c6858600
[ 24.923899] [<c041b1c0>] (ubifs_lookup) from [<c0298e5c>]
(path_openat+0x90c/0x1180)
[ 24.931672] r10:c497e678 r9:c69b5dc0 r8:c6a1fe28 r7:00020020
r6:c6a1fee8 r5:c496b730
[ 24.939524] r4:c6a1fdc4
[ 24.942089] [<c0298550>] (path_openat) from [<c029a7a0>]
(do_filp_open+0x78/0xe4)
[ 24.949601] r10:c6ae6c00 r9:025cfed8 r8:00000001 r7:c1108908
r6:c6a1fee8 r5:c6a1fe28
[ 24.957452] r4:c60e7000
[ 24.960017] [<c029a728>] (do_filp_open) from [<c028eb70>]
(do_open_execat+0x74/0x1a0)
[ 24.967876] r8:ffffff9c r7:00000000 r6:c60e7000 r5:c1108908 r4:c60e7000
[ 24.974607] [<c028eafc>] (do_open_execat) from [<c0290a98>]
(__do_execve_file+0x7ac/0xa2c)
[ 24.982900] r9:025cfed8 r8:ffffff9c r7:00000000 r6:c63ce400
r5:c1108908 r4:c60e7000
[ 24.990672] [<c02902ec>] (__do_execve_file) from [<c029100c>]
(sys_execve+0x3c/0x44)
[ 24.998443] r10:0000000b r9:c6a1e000 r8:c01011e4 r7:0000000b
r6:025c8998 r5:0257fc70
[ 25.006294] r4:025cfed8
[ 25.008858] [<c0290fd0>] (sys_execve) from [<c0101000>]
(ret_fast_syscall+0x0/0x28)
[ 25.016537] Exception stack(0xc6a1ffa8 to 0xc6a1fff0)
[ 25.021619] ffa0: ffffffff 0000003f 025a6b38
025cfed8 0257fc70 025a6c58
[ 25.029823] ffc0: ffffffff 0000003f 025c8998 0000000b 025cfed8
00000000 00000000 00000001
[ 25.038024] ffe0: 00574934 bea266b4 004b422f b6cfd2f8
[ 25.043100] r5:0000003f r4:ffffffff
[FAILED] Failed to start Connection service.
See 'systemctl status connman.service' for details.
[ OK ] Stopped Connection service.
Starting Connection service...
[ 25.737261] UBIFS error (ubi0:2 pid 153): ubifs_read_node: bad node
type (255 but expected 2)
[ 25.746167] UBIFS error (ubi0:2 pid 153): ubifs_read_node: bad node
at LEB 395:118520, LEB mapping status 1
[ 25.756118] Not a node, first 24 bytes:
[ 25.756149] 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff
........................
[ 25.773096] CPU: 0 PID: 153 Comm: (connmand) Not tainted 4.19.75 #1
[ 25.779393] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[ 25.785597] Backtrace:
[ 25.788091] [<c010e548>] (dump_backtrace) from [<c010e8d0>]
(show_stack+0x18/0x1c)
[ 25.795691] r7:00000000 r6:60000013 r5:00000000 r4:c11cf8d8
[ 25.801385] [<c010e8b8>] (show_stack) from [<c0b79708>]
(dump_stack+0xdc/0x114)
[ 25.808733] [<c0b7962c>] (dump_stack) from [<c0423f30>]
(ubifs_read_node+0x230/0x268)
[ 25.816597] r10:00000002 r9:c6858200 r8:00000041 r7:0000018b
r6:00000000 r5:0001cef8
[ 25.824449] r4:c6611000 r3:880c3d76
[ 25.828057] [<c0423d00>] (ubifs_read_node) from [<c0440b80>]
(ubifs_tnc_read_node+0xb0/0xb8)
[ 25.836526] r10:c6858200 r9:c1108908 r8:00000000 r7:c6611000
r6:c6858200 r5:00000002
[ 25.844375] r4:c6ae75c8
[ 25.846940] [<c0440ad0>] (ubifs_tnc_read_node) from [<c0425948>]
(tnc_read_hashed_node+0xa0/0x1bc)
[ 25.855924] r7:c6611198 r6:c6611000 r5:c6858200 r4:c6ae75c8
[ 25.861611] [<c04258a8>] (tnc_read_hashed_node) from [<c04271bc>]
(ubifs_tnc_locate.part.2+0x1cc/0x1f4)
[ 25.871029] r7:c6611198 r6:c6aa9d18 r5:00000000 r4:c6611000
[ 25.876719] [<c0426ff0>] (ubifs_tnc_locate.part.2) from
[<c0427998>] (ubifs_tnc_lookup_nm+0x3c/0x150)
[ 25.885966] r10:c6aa9d18 r9:c6aa9cfc r8:c6611000 r7:c6858200
r6:c47085d0 r5:c1108908
[ 25.893815] r4:c6858200
[ 25.896378] [<c042795c>] (ubifs_tnc_lookup_nm) from [<c041b2d4>]
(ubifs_lookup+0x114/0x300)
[ 25.904758] r10:0000106e r9:c6611000 r8:c1108908 r7:5e05a400
r6:c47085d0 r5:c49b55c0
[ 25.912608] r4:c6858200
[ 25.915177] [<c041b1c0>] (ubifs_lookup) from [<c0298e5c>]
(path_openat+0x90c/0x1180)
[ 25.922954] r10:c49b55c0 r9:c6a26280 r8:c6aa9e28 r7:00020020
r6:c6aa9ee8 r5:c496b730
[ 25.930804] r4:c6aa9dc4
[ 25.933369] [<c0298550>] (path_openat) from [<c029a7a0>]
(do_filp_open+0x78/0xe4)
[ 25.940882] r10:c6ae6c00 r9:025d0880 r8:00000001 r7:c1108908
r6:c6aa9ee8 r5:c6aa9e28
[ 25.948732] r4:c60e7000
[ 25.951300] [<c029a728>] (do_filp_open) from [<c028eb70>]
(do_open_execat+0x74/0x1a0)
[ 25.959159] r8:ffffff9c r7:00000000 r6:c60e7000 r5:c1108908 r4:c60e7000
[ 25.965892] [<c028eafc>] (do_open_execat) from [<c0290a98>]
(__do_execve_file+0x7ac/0xa2c)
[ 25.974187] r9:025d0880 r8:ffffff9c r7:00000000 r6:c63ce400
r5:c1108908 r4:c60e7000
[ 25.981958] [<c02902ec>] (__do_execve_file) from [<c029100c>]
(sys_execve+0x3c/0x44)
[ 25.989728] r10:0000000b r9:c6aa8000 r8:c01011e4 r7:0000000b
r6:025c8998 r5:0257fc70
[ 25.997581] r4:025d0880
[ 26.000145] [<c0290fd0>] (sys_execve) from [<c0101000>]
(ret_fast_syscall+0x0/0x28)
[ 26.007825] Exception stack(0xc6aa9fa8 to 0xc6aa9ff0)
[ 26.012907] 9fa0: ffffffff 0000003f 025a6b38
025d0880 0257fc70 025a6c58
[ 26.021113] 9fc0: ffffffff 0000003f 025c8998 0000000b 025d0880
00000000 00000000 00000001
[ 26.029314] 9fe0: 00574934 bea266b4 004b422f b6cfd2f8
[ 26.034389] r5:0000003f r4:ffffffff
[FAILED] Failed to start Connection service.
See 'systemctl status connman.service' for details.
[ OK ] Stopped Connection service.
Starting Connection service...
[ 26.498327] UBIFS error (ubi0:2 pid 154): ubifs_read_node: bad node
type (255 but expected 2)
[ 26.507283] UBIFS error (ubi0:2 pid 154): ubifs_read_node: bad node
at LEB 395:118520, LEB mapping status 1
[ 26.517243] Not a node, first 24 bytes:
[ 26.517275] 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff
........................
[ 26.534218] CPU: 0 PID: 154 Comm: (connmand) Not tainted 4.19.75 #1
[ 26.540513] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[ 26.546714] Backtrace:
[ 26.549210] [<c010e548>] (dump_backtrace) from [<c010e8d0>]
(show_stack+0x18/0x1c)
[ 26.556809] r7:00000000 r6:60000013 r5:00000000 r4:c11cf8d8
[ 26.562506] [<c010e8b8>] (show_stack) from [<c0b79708>]
(dump_stack+0xdc/0x114)
[ 26.569852] [<c0b7962c>] (dump_stack) from [<c0423f30>]
(ubifs_read_node+0x230/0x268)
[ 26.577714] r10:00000002 r9:c6858600 r8:00000041 r7:0000018b
r6:00000000 r5:0001cef8
[ 26.585568] r4:c6611000 r3:880c3d76
[ 26.589180] [<c0423d00>] (ubifs_read_node) from [<c0440b80>]
(ubifs_tnc_read_node+0xb0/0xb8)
[ 26.597648] r10:c6858600 r9:c1108908 r8:00000000 r7:c6611000
r6:c6858600 r5:00000002
[ 26.605500] r4:c6ae75c8
[ 26.608064] [<c0440ad0>] (ubifs_tnc_read_node) from [<c0425948>]
(tnc_read_hashed_node+0xa0/0x1bc)
[ 26.617050] r7:c6611198 r6:c6611000 r5:c6858600 r4:c6ae75c8
[ 26.622740] [<c04258a8>] (tnc_read_hashed_node) from [<c04271bc>]
(ubifs_tnc_locate.part.2+0x1cc/0x1f4)
[ 26.632158] r7:c6611198 r6:c6aa9d18 r5:00000000 r4:c6611000
[ 26.637847] [<c0426ff0>] (ubifs_tnc_locate.part.2) from
[<c0427998>] (ubifs_tnc_lookup_nm+0x3c/0x150)
[ 26.647093] r10:c6aa9d18 r9:c6aa9cfc r8:c6611000 r7:c6858600
r6:c47085d0 r5:c1108908
[ 26.654942] r4:c6858600
[ 26.657506] [<c042795c>] (ubifs_tnc_lookup_nm) from [<c041b2d4>]
(ubifs_lookup+0x114/0x300)
[ 26.665886] r10:0000106e r9:c6611000 r8:c1108908 r7:5e05a400
r6:c47085d0 r5:c497ec38
[ 26.673737] r4:c6858600
[ 26.676306] [<c041b1c0>] (ubifs_lookup) from [<c0298e5c>]
(path_openat+0x90c/0x1180)
[ 26.684080] r10:c497ec38 r9:c6a22000 r8:c6aa9e28 r7:00020020
r6:c6aa9ee8 r5:c496b730
[ 26.691932] r4:c6aa9dc4
[ 26.694500] [<c0298550>] (path_openat) from [<c029a7a0>]
(do_filp_open+0x78/0xe4)
[ 26.702012] r10:c6ae6c00 r9:025cfa98 r8:00000001 r7:c1108908
r6:c6aa9ee8 r5:c6aa9e28
[ 26.709862] r4:c60e7000
[ 26.712432] [<c029a728>] (do_filp_open) from [<c028eb70>]
(do_open_execat+0x74/0x1a0)
[ 26.720291] r8:ffffff9c r7:00000000 r6:c60e7000 r5:c1108908 r4:c60e7000
[ 26.727022] [<c028eafc>] (do_open_execat) from [<c0290a98>]
(__do_execve_file+0x7ac/0xa2c)
[ 26.735315] r9:025cfa98 r8:ffffff9c r7:00000000 r6:c63ce400
r5:c1108908 r4:c60e7000
[ 26.743087] [<c02902ec>] (__do_execve_file) from [<c029100c>]
(sys_execve+0x3c/0x44)
[ 26.750858] r10:0000000b r9:c6aa8000 r8:c01011e4 r7:0000000b
r6:025c8a18 r5:0257fc70
[ 26.758710] r4:025cfa98
[ 26.761275] [<c0290fd0>] (sys_execve) from [<c0101000>]
(ret_fast_syscall+0x0/0x28)
[ 26.768954] Exception stack(0xc6aa9fa8 to 0xc6aa9ff0)
[ 26.774037] 9fa0: ffffffff 0000003f 025a6b38
025cfa98 0257fc70 025a6c58
[ 26.782244] 9fc0: ffffffff 0000003f 025c8a18 0000000b 025cfa98
00000000 00000000 00000001
[ 26.790445] 9fe0: 00574934 bea266b4 004b422f b6cfd2f8
[ 26.795519] r5:0000003f r4:ffffffff
[FAILED] Failed to start Connection service.
See 'systemctl status connman.service' for details.
[ OK ] Stopped Connection service.
Starting Connection service...
[ 27.263988] UBIFS error (ubi0:2 pid 155): ubifs_read_node: bad node
type (255 but expected 2)
[ 27.272941] UBIFS error (ubi0:2 pid 155): ubifs_read_node: bad node
at LEB 395:118520, LEB mapping status 1
[ 27.282903] Not a node, first 24 bytes:
[ 27.282934] 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff
........................
[ 27.299803] CPU: 0 PID: 155 Comm: (connmand) Not tainted 4.19.75 #1
[ 27.306101] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[ 27.312305] Backtrace:
[ 27.314799] [<c010e548>] (dump_backtrace) from [<c010e8d0>]
(show_stack+0x18/0x1c)
[ 27.322399] r7:00000000 r6:60000013 r5:00000000 r4:c11cf8d8
[ 27.328095] [<c010e8b8>] (show_stack) from [<c0b79708>]
(dump_stack+0xdc/0x114)
[ 27.335442] [<c0b7962c>] (dump_stack) from [<c0423f30>]
(ubifs_read_node+0x230/0x268)
[ 27.343305] r10:00000002 r9:c6858200 r8:00000041 r7:0000018b
r6:00000000 r5:0001cef8
[ 27.351158] r4:c6611000 r3:880c3d76
[ 27.354767] [<c0423d00>] (ubifs_read_node) from [<c0440b80>]
(ubifs_tnc_read_node+0xb0/0xb8)
[ 27.363237] r10:c6858200 r9:c1108908 r8:00000000 r7:c6611000
r6:c6858200 r5:00000002
[ 27.371088] r4:c6ae75c8
[ 27.373651] [<c0440ad0>] (ubifs_tnc_read_node) from [<c0425948>]
(tnc_read_hashed_node+0xa0/0x1bc)
[ 27.382636] r7:c6611198 r6:c6611000 r5:c6858200 r4:c6ae75c8
[ 27.388323] [<c04258a8>] (tnc_read_hashed_node) from [<c04271bc>]
(ubifs_tnc_locate.part.2+0x1cc/0x1f4)
[ 27.397742] r7:c6611198 r6:c6aa9d18 r5:00000000 r4:c6611000
[ 27.403430] [<c0426ff0>] (ubifs_tnc_locate.part.2) from
[<c0427998>] (ubifs_tnc_lookup_nm+0x3c/0x150)
[ 27.412677] r10:c6aa9d18 r9:c6aa9cfc r8:c6611000 r7:c6858200
r6:c47085d0 r5:c1108908
[ 27.420526] r4:c6858200
[ 27.423090] [<c042795c>] (ubifs_tnc_lookup_nm) from [<c041b2d4>]
(ubifs_lookup+0x114/0x300)
[ 27.431470] r10:0000106e r9:c6611000 r8:c1108908 r7:5e05a400
r6:c47085d0 r5:c49b9c38
[ 27.439320] r4:c6858200
[ 27.441888] [<c041b1c0>] (ubifs_lookup) from [<c0298e5c>]
(path_openat+0x90c/0x1180)
[ 27.449662] r10:c49b9c38 r9:c691a280 r8:c6aa9e28 r7:00020020
r6:c6aa9ee8 r5:c496b730
[ 27.457512] r4:c6aa9dc4
[ 27.460077] [<c0298550>] (path_openat) from [<c029a7a0>]
(do_filp_open+0x78/0xe4)
[ 27.467589] r10:c6ae6c00 r9:025cfc38 r8:00000001 r7:c1108908
r6:c6aa9ee8 r5:c6aa9e28
[ 27.475440] r4:c60e7000
[ 27.478006] [<c029a728>] (do_filp_open) from [<c028eb70>]
(do_open_execat+0x74/0x1a0)
[ 27.485867] r8:ffffff9c r7:00000000 r6:c60e7000 r5:c1108908 r4:c60e7000
[ 27.492598] [<c028eafc>] (do_open_execat) from [<c0290a98>]
(__do_execve_file+0x7ac/0xa2c)
[ 27.500890] r9:025cfc38 r8:ffffff9c r7:00000000 r6:c63ce400
r5:c1108908 r4:c60e7000
[ 27.508662] [<c02902ec>] (__do_execve_file) from [<c029100c>]
(sys_execve+0x3c/0x44)
[ 27.516432] r10:0000000b r9:c6aa8000 r8:c01011e4 r7:0000000b
r6:025c8998 r5:0257fc70
[ 27.524283] r4:025cfc38
[ 27.526847] [<c0290fd0>] (sys_execve) from [<c0101000>]
(ret_fast_syscall+0x0/0x28)
[ 27.534527] Exception stack(0xc6aa9fa8 to 0xc6aa9ff0)
[ 27.539607] 9fa0: ffffffff 0000003f 025a6b38
025cfc38 0257fc70 025a6c58
[ 27.547812] 9fc0: ffffffff 0000003f 025c8998 0000000b 025cfc38
00000000 00000000 00000001
[ 27.556013] 9fe0: 00574934 bea266b4 004b422f b6cfd2f8
[ 27.561088] r5:0000003f r4:ffffffff
[FAILED] Failed to start Connection service.
root#
Thank you and appreciate your insite comments.
Kind regards,
- jh
2 years, 4 months
Why is dbus mandatory
by Louis Rannou
Hi,
I wonder why is dbus mandatory ? Is it just for the client and plugins
or is it part of the core ?
We would like to use connman but we'd like it to be as small as
possible. Could you say it's possible to get rid of dbus ?
I looked for technical documentation such as architecture, but I could
not find any.
Thanks
Louis
2 years, 4 months
MTU
by Damien LEFEVRE
Hi!
What's the correct way to set the MTU with connman? All I see from the doc
is that the value is reported as read-only
I have a yocto system where I tried to use systemd-networkd for setting the
MTU only. Out of 2 interfaces, one goes crazy after the DHCP request goes
through and I'm not able to ping from it or the device from another PC. The
network adapter led is flashing until I restart the connman service.
Thanks,
-Damien
2 years, 4 months
[PATCH] vpn: Split nameservers strings correctly
by Daniel Wagner
g_strsplit_set() splits the string into a number of tokens not
containing any of the characters in delimiter.
Fixes: 07d35c17e307 ("vpn-provider: Split nameserver string also by comma")
---
vpn/vpn-provider.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c
index d104ed87260a..5ce932872bbb 100644
--- a/vpn/vpn-provider.c
+++ b/vpn/vpn-provider.c
@@ -2852,7 +2852,7 @@ int vpn_provider_set_nameservers(struct vpn_provider *provider,
if (!nameservers)
return 0;
- provider->nameservers = g_strsplit(nameservers, ", ", 0);
+ provider->nameservers = g_strsplit_set(nameservers, ", ", 0);
return 0;
}
--
2.25.0
2 years, 4 months
Next release (take 2)
by Daniel Wagner
Hi,
I think the current head is now pretty stable, at least all the bug
reports we got be fixed. So let's do a release.
@Marcel, can you do the magic steps for the release? Alternatively I
can do the release if you have no time.
Thanks,
Daniel
2 years, 4 months
[RFC] service: Add support to set MTU via D-Bus interface
by Daniel Wagner
---
Well this could be a way to set the MTU via D-Bus. Not sure if this is
a good idea to do this way.
doc/service-api.txt | 6 +++
src/service.c | 103 ++++++++++++++++++++++++++++++++++++++++--
test/get-services | 3 +-
test/list-services | 4 +-
test/monitor-services | 4 +-
test/set-ethernet | 31 +++++++++++++
test/test-manager | 5 +-
7 files changed, 146 insertions(+), 10 deletions(-)
create mode 100755 test/set-ethernet
diff --git a/doc/service-api.txt b/doc/service-api.txt
index c0d5adbb2b57..da514160dd61 100644
--- a/doc/service-api.txt
+++ b/doc/service-api.txt
@@ -508,6 +508,12 @@ Properties string State [readonly]
This information is not available.
+ dict Ethernet.Configuration [readwrite]
+
+ uint16 MTU [readwrite]
+
+ The Ethernet MTU (default is 1500).
+
bool mDNS [readonly]
Whether or not mDNS support is enabled. Note
diff --git a/src/service.c b/src/service.c
index 2f497d10cef1..6c9a75a28738 100644
--- a/src/service.c
+++ b/src/service.c
@@ -93,6 +93,7 @@ struct connman_service {
bool roaming;
struct connman_ipconfig *ipconfig_ipv4;
struct connman_ipconfig *ipconfig_ipv6;
+ unsigned short mtu;
struct connman_network *network;
struct connman_provider *provider;
char **nameservers;
@@ -557,6 +558,9 @@ static int service_load(struct connman_service *service)
__connman_ipconfig_load(service->ipconfig_ipv6, keyfile,
service->identifier, "IPv6.");
+ service->mtu = g_key_file_get_integer(keyfile,
+ service->identifier, "MTU", 0);
+
service->nameservers_config = g_key_file_get_string_list(keyfile,
service->identifier, "Nameservers", &length, NULL);
if (service->nameservers_config && length == 0) {
@@ -721,6 +725,10 @@ static int service_save(struct connman_service *service)
__connman_ipconfig_save(service->ipconfig_ipv6, keyfile,
service->identifier, "IPv6.");
+ if (service->mtu)
+ g_key_file_set_integer(keyfile, service->identifier,
+ "MTU", service->mtu);
+
if (service->nameservers_config) {
guint len = g_strv_length(service->nameservers_config);
@@ -1760,6 +1768,15 @@ static void append_ethernet(DBusMessageIter *iter, void *user_data)
iter);
}
+static void append_ethernetconfig(DBusMessageIter *iter, void *user_data)
+{
+ struct connman_service *service = user_data;
+
+ if (service->mtu)
+ connman_dbus_dict_append_basic(iter, "MTU",
+ DBUS_TYPE_UINT16, &service->mtu);
+}
+
static void append_ipv4(DBusMessageIter *iter, void *user_data)
{
struct connman_service *service = user_data;
@@ -2210,6 +2227,27 @@ static int set_mdns(struct connman_service *service,
return result;
}
+
+static void mtu_configuration_changed(struct connman_service *service)
+{
+ if (!allow_property_changed(service))
+ return;
+
+ connman_dbus_property_changed_dict(service->path,
+ CONNMAN_SERVICE_INTERFACE,
+ "Ethernet.Configuration",
+ append_ethernetconfig,
+ service);
+}
+
+static int set_mtu(struct connman_service *service,
+ unsigned short mtu)
+{
+ int index = __connman_service_get_index(service);
+
+ return connman_inet_set_mtu(index, mtu);
+}
+
static void timeservers_configuration_changed(struct connman_service *service)
{
if (!allow_property_changed(service))
@@ -2532,16 +2570,16 @@ static void append_properties(DBusMessageIter *dict, dbus_bool_t limited,
val = service->roaming;
connman_dbus_dict_append_basic(dict, "Roaming",
DBUS_TYPE_BOOLEAN, &val);
-
- connman_dbus_dict_append_dict(dict, "Ethernet",
- append_ethernet, service);
- break;
+ /* fall through */
case CONNMAN_SERVICE_TYPE_WIFI:
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_BLUETOOTH:
case CONNMAN_SERVICE_TYPE_GADGET:
connman_dbus_dict_append_dict(dict, "Ethernet",
append_ethernet, service);
+
+ connman_dbus_dict_append_dict(dict, "Ethernet.Configuration",
+ append_ethernetconfig, service);
break;
}
@@ -3860,6 +3898,57 @@ static DBusMessage *set_property(DBusConnection *conn,
}
service_save(service);
+ } else if (g_str_equal(name, "Ethernet.Configuration")) {
+ DBusMessageIter dict;
+
+ if (service->immutable)
+ return __connman_error_not_supported(msg);
+
+ if (type != DBUS_TYPE_ARRAY)
+ return __connman_error_invalid_arguments(msg);
+
+ dbus_message_iter_recurse(&value, &dict);
+
+ while (dbus_message_iter_get_arg_type(&dict) ==
+ DBUS_TYPE_DICT_ENTRY) {
+ DBusMessageIter entry, variant;
+ const char *key;
+ int type;
+
+ dbus_message_iter_recurse(&dict, &entry);
+ if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_STRING)
+ return __connman_error_invalid_arguments(msg);
+
+ dbus_message_iter_get_basic(&entry, &key);
+ dbus_message_iter_next(&entry);
+
+ if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_VARIANT)
+ return __connman_error_invalid_arguments(msg);
+
+ dbus_message_iter_recurse(&entry, &variant);
+ type = dbus_message_iter_get_arg_type(&variant);
+
+ if (!strcmp(key, "MTU")) {
+ dbus_uint16_t val;
+
+ if (type != DBUS_TYPE_UINT16)
+ return __connman_error_invalid_arguments(msg);
+
+ dbus_message_iter_get_basic(&variant, &val);
+ if (val >= 64) {
+ service->mtu = val;
+ set_mtu(service, service->mtu);
+ } else {
+ service->mtu = 0;
+ set_mtu(service, 1500);
+ }
+
+ mtu_configuration_changed(service);
+
+ service_save(service);
+ }
+ dbus_message_iter_next(&dict);
+ }
} else
return __connman_error_invalid_property(msg);
@@ -6567,6 +6656,12 @@ int __connman_service_connect(struct connman_service *service,
__connman_service_clear_error(service);
+ if (service->mtu) {
+ err = set_mtu(service, service->mtu);
+ if (err)
+ connman_warn("Failed to set MTU size %d", service->mtu);
+ }
+
err = service_connect(service);
DBG("service %p err %d", service, err);
diff --git a/test/get-services b/test/get-services
index 2fa8b5b75da8..4d0e1b656bc2 100755
--- a/test/get-services
+++ b/test/get-services
@@ -37,7 +37,8 @@ services = manager.GetServices()
if key in ["IPv4", "IPv4.Configuration",
"IPv6", "IPv6.Configuration",
"Proxy", "Proxy.Configuration",
- "Ethernet", "Provider"]:
+ "Ethernet", "Ethernet.Configuration",
+ "Provider"]:
val = extract_values(properties[key])
elif key in ["Nameservers", "Nameservers.Configuration",
"Domains", "Domains.Configuration",
diff --git a/test/list-services b/test/list-services
index 4accf773022c..786c9e976039 100755
--- a/test/list-services
+++ b/test/list-services
@@ -40,8 +40,8 @@ manager = dbus.Interface(bus.get_object("net.connman", "/"),
if key in ["IPv4", "IPv4.Configuration",
"IPv6", "IPv6.Configuration",
"Proxy", "Proxy.Configuration",
- "Ethernet", "Provider",
- "LastAddressConflict"]:
+ "Ethernet", "Ethernet.Configuration",
+ "Provider", "LastAddressConflict"]:
val = extract_values(properties[key])
elif key in ["Nameservers", "Nameservers.Configuration",
"Domains", "Domains.Configuration",
diff --git a/test/monitor-services b/test/monitor-services
index d570e5f57d9c..414b4d69f297 100755
--- a/test/monitor-services
+++ b/test/monitor-services
@@ -32,7 +32,9 @@ import dbus.mainloop.glib
val = val + " ]"
elif name in ["IPv4", "IPv4.Configuration",
"IPv6", "IPv6.Configuration",
- "Proxy", "Proxy.Configuration", "Ethernet", "Provider"]:
+ "Proxy", "Proxy.Configuration",
+ "Ethernet", "Ethernet.Configuration",
+ "Provider"]:
val = extract_values(value)
elif name in ["Nameservers", "Nameservers.Configuration",
"Domains", "Domains.Configuration",
diff --git a/test/set-ethernet b/test/set-ethernet
new file mode 100755
index 000000000000..fc1ef7770ab0
--- /dev/null
+++ b/test/set-ethernet
@@ -0,0 +1,31 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+def make_variant(string):
+ return dbus.UInt16(string, variant_level=1)
+
+def print_usage():
+ print("Usage: %s <service> [mtu <size>]" % (sys.argv[0]))
+
+
+if (len(sys.argv) < 3):
+ print_usage()
+ sys.exit(1)
+
+bus = dbus.SystemBus()
+path = "/net/connman/service/" + sys.argv[1]
+service = dbus.Interface(bus.get_object('net.connman', path),
+ 'net.connman.Service')
+
+properties = service.GetProperties()
+
+print("Setting method %s for %s" % (sys.argv[2], sys.argv[1]))
+
+eth_configuration = { "MTU": make_variant(sys.argv[3]) }
+
+service.SetProperty("Ethernet.Configuration", eth_configuration)
+print("New Ethernet.Configuration: ", eth_configuration)
+
+print()
diff --git a/test/test-manager b/test/test-manager
index 2bc53acc3c77..aaba98b985fa 100755
--- a/test/test-manager
+++ b/test/test-manager
@@ -58,8 +58,9 @@ services = manager.GetServices()
elif key in ["IPv4", "IPv4.Configuration",
"IPv6", "IPv6.Configuration",
- "Proxy", "Proxy.Configuration",
- "Ethernet", "Provider"]:
+ "Proxy", "Proxy.Configuration",
+ "Ethernet", "Ethernet.Configuration",
+ "Provider"]:
val = extract_values(properties[key])
elif key in ["Nameservers", "Nameservers.Configuration",
--
2.25.0
2 years, 4 months
[PATCH] coding-style: Update M8 about g_malloc use
by Daniel Wagner
Document the useles effort to handle small memory allocations. Even
the small test program below shows glibc's malloc wont return a NULL allocation. The
program will be killed by the OOM.
int main(int argc, char *argv[])
{
while (1) {
if (!malloc(16))
exit(3);
}
return 0;
}
$ ./malloc
[1] 25788 killed ./malloc
$ echo $?
137
[ 2729.844036] Out of memory: Killed process 25745 (malloc) total-vm:15131480kB, anon-rss:14977108kB, file-rss:948kB, shmem-rss:0kB
[ 2730.091798] oom_reaper: reaped process 25745 (malloc), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
Linux userland system programming is different to embedded systems
where any sized malloc can and *will* fail.
---
doc/coding-style.txt | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/doc/coding-style.txt b/doc/coding-style.txt
index 97410ce72584..c2fdc717a14e 100644
--- a/doc/coding-style.txt
+++ b/doc/coding-style.txt
@@ -155,10 +155,19 @@ for (i = 0; i < 3; i++) {
}
-M8: Use g_try_malloc instead of g_malloc
-========================================
-When g_malloc fails, the whole program would exit. Most of time, this is not
-the expected behavior, and you may want to use g_try_malloc instead.
+M8: Abort if small allocation fail
+==================================
+When g_malloc fails, the whole program would exit. Small allocations
+are very unlikely to fail and if an allocations is not possible, it is
+very likely the error code can't recover from this
+situation. Furthermore, many of the error paths are not tested at
+all. Instead use g_malloc() when the allocation fails and rely on an
+external watchdog to restart the program.
+
+Furthermore, Glib's functions such as g_strdup use g_malloc which
+obviously terminates the program anyway.
+
+For large allocation using g_try_malloc is still the right choice.
Example:
additional = g_try_malloc(len - 1); // correct
--
2.24.0
2 years, 4 months
[PATCH] test: Add support for Python3
by Daniel Wagner
Python2 is EOL, it's time to update our test script to run with
Python3. The conversion was done using 2to3 and most of the scripts
will run with both versions. Since most of the transformation is about
updating the print commands. Only a quick smoke test was done.
---
test/backtrace | 8 +--
test/connect-provider | 24 ++++-----
test/disable-tethering | 8 +--
test/enable-tethering | 10 ++--
test/get-global-timeservers | 2 +-
test/get-proxy-autoconfig | 16 +++---
test/get-services | 10 ++--
test/get-state | 2 +-
test/list-services | 10 ++--
test/monitor-connman | 4 +-
test/monitor-services | 16 +++---
test/monitor-vpn | 4 +-
test/p2p-on-supplicant | 92 ++++++++++++++++-----------------
test/remove-provider | 4 +-
test/service-move-before | 6 +--
test/set-clock | 4 +-
test/set-domains | 4 +-
test/set-global-timeservers | 4 +-
test/set-ipv4-method | 8 +--
test/set-ipv6-method | 8 +--
test/set-nameservers | 4 +-
test/set-proxy | 16 +++---
test/set-timeservers | 4 +-
test/set-timezone | 8 +--
test/show-introspection | 4 +-
test/simple-agent | 88 +++++++++++++++----------------
test/test-clock | 6 +--
test/test-compat | 2 +-
test/test-connman | 78 ++++++++++++++--------------
test/test-counter | 10 ++--
test/test-manager | 26 +++++-----
test/test-new-supplicant | 2 +-
test/test-session | 100 ++++++++++++++++++------------------
test/vpn-connect | 4 +-
test/vpn-disconnect | 4 +-
test/vpn-get | 10 ++--
test/vpn-property | 18 +++----
37 files changed, 312 insertions(+), 316 deletions(-)
diff --git a/test/backtrace b/test/backtrace
index c906f3696c46..c6247090605a 100755
--- a/test/backtrace
+++ b/test/backtrace
@@ -6,7 +6,7 @@ import sys
import subprocess
if (len(sys.argv) < 3):
- print "Usage: %s [binary] [log]" % (sys.argv[0])
+ print("Usage: %s [binary] [log]" % (sys.argv[0]))
sys.exit(1)
binary = sys.argv[1]
@@ -50,8 +50,8 @@ child_stdout.close()
frame_count = len(frames);
count = 0
-print "-------- backtrace --------"
+print("-------- backtrace --------")
while count < frame_count:
- print "[%d]: %s() [%s]" % (count/2, frames[count], frames[count + 1])
+ print("[%d]: %s() [%s]" % (count/2, frames[count], frames[count + 1]))
count = count + 2
-print "---------------------------"
+print("---------------------------")
diff --git a/test/connect-provider b/test/connect-provider
index 15128c85267f..504bce47acde 100755
--- a/test/connect-provider
+++ b/test/connect-provider
@@ -4,15 +4,15 @@ import sys
import dbus
if (len(sys.argv) < 4):
- print "Usage: %s <type> ... " % (sys.argv[0])
- print " type: openconnect"
- print " <name> <host> <domain> <cookie> [servercert]"
- print " type: openvpn"
- print " <name> <host> <domain> [<cafile> <certfile> <keyfile>]"
- print " type: pptp"
- print " <name> <host> <domain> <user> <password>"
- print " type: l2tp"
- print " <name> <host> <domain> <user> <password>"
+ print("Usage: %s <type> ... " % (sys.argv[0]))
+ print(" type: openconnect")
+ print(" <name> <host> <domain> <cookie> [servercert]")
+ print(" type: openvpn")
+ print(" <name> <host> <domain> [<cafile> <certfile> <keyfile>]")
+ print(" type: pptp")
+ print(" <name> <host> <domain> <user> <password>")
+ print(" type: l2tp")
+ print(" <name> <host> <domain> <user> <password>")
sys.exit(1)
bus = dbus.SystemBus()
@@ -20,7 +20,7 @@ bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object("net.connman", "/"),
"net.connman.Manager")
-print "Attempting to connect service %s" % (sys.argv[3])
+print("Attempting to connect service %s" % (sys.argv[3]))
if sys.argv[1] == "openconnect":
if (len(sys.argv) > 6):
@@ -67,7 +67,7 @@ print "Attempting to connect service %s" % (sys.argv[3])
"L2TP.Password": sys.argv[6]}))
else:
- print "Unknown VPN type"
+ print("Unknown VPN type")
sys.exit(1)
-print "VPN service path is %s" %(path)
+print("VPN service path is %s" %(path))
diff --git a/test/disable-tethering b/test/disable-tethering
index a3d5908c35d9..41f3d798567e 100755
--- a/test/disable-tethering
+++ b/test/disable-tethering
@@ -4,7 +4,7 @@ import sys
import dbus
if (len(sys.argv) != 2):
- print "Usage: %s type" % (sys.argv[0])
+ print("Usage: %s type" % (sys.argv[0]))
sys.exit(1)
bus = dbus.SystemBus()
@@ -18,10 +18,10 @@ manager = dbus.Interface(bus.get_object('net.connman', "/"),
properties = tech.GetProperties()
- for key in properties.keys():
+ for key in list(properties.keys()):
if key in ["Type"]:
if properties[key] == tech_type:
- print "Disabling %s tethering" % tech_type
+ print("Disabling %s tethering" % tech_type)
tech.SetProperty("Tethering", dbus.Boolean(0))
return tech_type
@@ -37,4 +37,4 @@ tech = None
break;
if tech == None:
- print "Failed to disable %s tethering" % (sys.argv[1])
+ print("Failed to disable %s tethering" % (sys.argv[1]))
diff --git a/test/enable-tethering b/test/enable-tethering
index cbcd4e72651a..13e5a18c4d34 100755
--- a/test/enable-tethering
+++ b/test/enable-tethering
@@ -4,10 +4,10 @@ import sys
import dbus
if (len(sys.argv) >= 3 and len(sys.argv) != 4 and sys.argv[1] == "wifi"):
- print "Usage: %s wifi [SSID] [passphrase]" % (sys.argv[0])
+ print("Usage: %s wifi [SSID] [passphrase]" % (sys.argv[0]))
sys.exit(1)
elif (len(sys.argv) < 2):
- print "Usage: %s type" % (sys.argv[0])
+ print("Usage: %s type" % (sys.argv[0]))
sys.exit(1)
bus = dbus.SystemBus()
@@ -21,7 +21,7 @@ manager = dbus.Interface(bus.get_object('net.connman', "/"),
properties = tech.GetProperties()
- for key in properties.keys():
+ for key in list(properties.keys()):
if key in ["Type"]:
if properties[key] == tech_type:
if len(ssid) > 0:
@@ -30,7 +30,7 @@ manager = dbus.Interface(bus.get_object('net.connman', "/"),
if len(psk) > 0:
tech.SetProperty("TetheringPassphrase",
psk)
- print "Enabling %s tethering" % tech_type
+ print("Enabling %s tethering" % tech_type)
tech.SetProperty("Tethering", dbus.Boolean(1))
return tech_type
@@ -51,4 +51,4 @@ tech = None
break;
if tech == None:
- print "Failed to enable %s tethering" % (sys.argv[1])
+ print("Failed to enable %s tethering" % (sys.argv[1]))
diff --git a/test/get-global-timeservers b/test/get-global-timeservers
index adcf175a27e0..2436b36369ed 100755
--- a/test/get-global-timeservers
+++ b/test/get-global-timeservers
@@ -9,4 +9,4 @@ clock = dbus.Interface(bus.get_object('net.connman', '/'),
properties = clock.GetProperties()
-print "Timeserver is %s" % (properties["Timeservers"])
+print("Timeserver is %s" % (properties["Timeservers"]))
diff --git a/test/get-proxy-autoconfig b/test/get-proxy-autoconfig
index 6709a9e89756..b96e800e8927 100755
--- a/test/get-proxy-autoconfig
+++ b/test/get-proxy-autoconfig
@@ -1,12 +1,12 @@
#!/usr/bin/python
import dbus
-import urllib
+import urllib.request, urllib.parse, urllib.error
def get_pac(url):
- conn = urllib.urlopen(url, proxies={})
+ conn = urllib.request.urlopen(url, proxies={})
data = conn.read()
- print data
+ print(data)
conn.close()
bus = dbus.SystemBus()
@@ -23,15 +23,15 @@ services = manager.GetServices()
proxy = properties["Proxy"]
if "Method" in proxy:
- print "[ %s ]" % (path)
+ print("[ %s ]" % (path))
method = proxy["Method"]
- print "Method = %s" % (method)
+ print("Method = %s" % (method))
if method in ["auto"]:
url = proxy["URL"]
- print "URL = %s" % (url)
- print
+ print("URL = %s" % (url))
+ print()
get_pac(url)
else:
- print
+ print()
diff --git a/test/get-services b/test/get-services
index 095648044ab2..2fa8b5b75da8 100755
--- a/test/get-services
+++ b/test/get-services
@@ -4,7 +4,7 @@ import dbus
def extract_values(values):
val = "{"
- for key in values.keys():
+ for key in list(values.keys()):
val += " " + key + "="
if key in ["Servers", "Excludes"]:
val += extract_list(values[key])
@@ -31,9 +31,9 @@ services = manager.GetServices()
path = entry[0]
properties = entry[1]
- print "[ %s ]" % (path)
+ print("[ %s ]" % (path))
- for key in properties.keys():
+ for key in list(properties.keys()):
if key in ["IPv4", "IPv4.Configuration",
"IPv6", "IPv6.Configuration",
"Proxy", "Proxy.Configuration",
@@ -53,6 +53,6 @@ services = manager.GetServices()
val = int(properties[key])
else:
val = str(properties[key])
- print " %s = %s" % (key, val)
+ print(" %s = %s" % (key, val))
- print
+ print()
diff --git a/test/get-state b/test/get-state
index 75d5a16a7fe9..e991f58306c3 100755
--- a/test/get-state
+++ b/test/get-state
@@ -9,4 +9,4 @@ manager = dbus.Interface(bus.get_object('net.connman', "/"),
properties = manager.GetProperties()
-print "System is %s" % (properties["State"])
+print("System is %s" % (properties["State"]))
diff --git a/test/list-services b/test/list-services
index a2610d7e1060..4accf773022c 100755
--- a/test/list-services
+++ b/test/list-services
@@ -4,7 +4,7 @@ import dbus
def extract_values(values):
val = "{"
- for key in values.keys():
+ for key in list(values.keys()):
val += " " + key + "="
if key in ["PrefixLength"]:
val += "%s" % (int(values[key]))
@@ -34,9 +34,9 @@ manager = dbus.Interface(bus.get_object("net.connman", "/"),
service = dbus.Interface(bus.get_object("net.connman", path),
"net.connman.Service")
identifier = path[path.rfind("/") + 1:]
- print "[ %s ]" % (identifier)
+ print("[ %s ]" % (identifier))
- for key in properties.keys():
+ for key in list(properties.keys()):
if key in ["IPv4", "IPv4.Configuration",
"IPv6", "IPv6.Configuration",
"Proxy", "Proxy.Configuration",
@@ -58,6 +58,6 @@ manager = dbus.Interface(bus.get_object("net.connman", "/"),
val = int(properties[key])
else:
val = properties[key]
- print " %s = %s" % (key, val)
+ print(" %s = %s" % (key, val))
- print
+ print()
diff --git a/test/monitor-connman b/test/monitor-connman
index 1b3b84c74970..8403f913051b 100755
--- a/test/monitor-connman
+++ b/test/monitor-connman
@@ -19,7 +19,7 @@ from dbus.lowlevel import MethodCallMessage, HANDLER_RESULT_NOT_YET_HANDLED
def extract_values(values):
val = "{"
- for key in values.keys():
+ for key in list(values.keys()):
val += " " + key + "="
if key in ["PrefixLength"]:
val += "%s" % (int(values[key]))
@@ -54,7 +54,7 @@ from dbus.lowlevel import MethodCallMessage, HANDLER_RESULT_NOT_YET_HANDLED
iface = interface[interface.rfind(".") + 1:]
val = extract(name, value)
- print "{%s} [%s] %s = %s" % (iface, path, name, val)
+ print("{%s} [%s] %s = %s" % (iface, path, name, val))
def message_filter(connection, message):
if not isinstance(message, MethodCallMessage):
diff --git a/test/monitor-services b/test/monitor-services
index 9476bf8f4d2e..d570e5f57d9c 100755
--- a/test/monitor-services
+++ b/test/monitor-services
@@ -7,7 +7,7 @@ import dbus.mainloop.glib
def extract_values(values):
val = "{"
- for key in values.keys():
+ for key in list(values.keys()):
val += " " + key + "="
if key in ["Servers", "Excludes"]:
val += extract_list(values[key])
@@ -42,27 +42,27 @@ import dbus.mainloop.glib
val = int(value)
else:
val = str(value)
- print "[%s] %s = %s" % (service, name, val)
+ print("[%s] %s = %s" % (service, name, val))
def services_changed(services, removed):
for i in services:
service = i[0][i[0].rfind("/") + 1:]
- print "[%s] changed" % (service)
- for n in i[1].keys():
+ print("[%s] changed" % (service))
+ for n in list(i[1].keys()):
property_changed(n, i[1][n], i[0])
for i in removed:
service = i[i.rfind("/") + 1:]
- print "[%s] removed" % (service)
+ print("[%s] removed" % (service))
def technology_added(path, properties):
technology = path[path.rfind("/") + 1:]
- print "[%s] added" % (technology)
- for n in properties.keys():
+ print("[%s] added" % (technology))
+ for n in list(properties.keys()):
property_changed(n, properties[n], technology)
def technology_removed(path):
technology = path[path.rfind("/") + 1:]
- print "[%s] removed" % (technology)
+ print("[%s] removed" % (technology))
if __name__ == '__main__':
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
diff --git a/test/monitor-vpn b/test/monitor-vpn
index 2b6368717056..e019e6ec9b65 100755
--- a/test/monitor-vpn
+++ b/test/monitor-vpn
@@ -21,7 +21,7 @@ from dbus.lowlevel import MethodCallMessage, HANDLER_RESULT_NOT_YET_HANDLED
def extract_values(values):
val = "{"
- for key in values.keys():
+ for key in list(values.keys()):
val += " " + key + "="
if key in ["ProtocolFamily"]:
val += "%s" % (int(values[key]))
@@ -50,7 +50,7 @@ from dbus.lowlevel import MethodCallMessage, HANDLER_RESULT_NOT_YET_HANDLED
iface = interface[interface.rfind(".") + 1:]
val = extract(name, value)
- print "{%s} [%s] %s = %s" % (iface, path, name, val)
+ print("{%s} [%s] %s = %s" % (iface, path, name, val))
def message_filter(connection, message):
if not isinstance(message, MethodCallMessage):
diff --git a/test/p2p-on-supplicant b/test/p2p-on-supplicant
index 8cc76e818379..1ae036ba6421 100755
--- a/test/p2p-on-supplicant
+++ b/test/p2p-on-supplicant
@@ -38,7 +38,7 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
def prompt(self):
self.line = ''
- print '> ',
+ print('> ', end=' ')
stdout.flush()
def input_cb(self, fd, event):
@@ -58,7 +58,7 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
return True
def error_print(ex):
- print 'Command Error: %s' % ex
+ print('Command Error: %s' % ex)
def checkarg(nb_args = 0, min_args = False):
def under(function):
@@ -81,11 +81,11 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
for k in d:
try:
if type(d[k]) is dbus.Byte:
- print 'Key %s --> 0x%x' % (k, d[k])
+ print('Key %s --> 0x%x' % (k, d[k]))
else:
- print 'Key %s --> %s' % (k, d[k])
+ print('Key %s --> %s' % (k, d[k]))
except:
- print "Error: Key %s content cannot be printed" % k
+ print("Error: Key %s content cannot be printed" % k)
pass
def print_tuple(t):
@@ -93,7 +93,7 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
if type(e) is dbus.Dictionary:
print_dict(e)
else:
- print 'Element: %s' % e
+ print('Element: %s' % e)
class Wpa_s:
def __init__(self, bus, iface_name, command):
@@ -116,41 +116,41 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
try:
self.create_if([iface_name])
except:
- print "Error creating interface: %s" % iface_name
+ print("Error creating interface: %s" % iface_name)
if len(command.strip(' ')):
self.__command(command)
def help(self, args):
- list = self.command_list.keys()
+ list = list(self.command_list.keys())
list.sort()
for key in list:
help = ''
- if (self.command_list[key].has_key(ArgFields.help)):
+ if (ArgFields.help in self.command_list[key]):
help = self.command_list[key][ArgFields.help]
- print "%s\t%s" % (key.rjust(25), help.ljust(50))
+ print("%s\t%s" % (key.rjust(25), help.ljust(50)))
def __command(self, cmd_line):
cmd = cmd_line.split(' ')
try:
func = getattr(self, cmd[0])
- except Exception, e:
- print 'Error: command unknown - %s' % e
+ except Exception as e:
+ print('Error: command unknown - %s' % e)
return
try:
func(cmd[1:])
- except Exception, e:
+ except Exception as e:
error_print(e)
def __wpa_property_changed(*args, **kwargs):
- print 'WPA - Signal: %s' % kwargs.get('signal')
+ print('WPA - Signal: %s' % kwargs.get('signal'))
def __if_property_changed(*args, **kwargs):
signal = kwargs.get('signal')
- print 'IF - Signal: %s' % signal
+ print('IF - Signal: %s' % signal)
if signal == 'BSSAdded':
return
@@ -159,12 +159,12 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
print_tuple(args[1:])
def __p2p_property_changed(*args, **kwargs):
- print 'IF P2P - Signal: %s' % kwargs.get('signal')
+ print('IF P2P - Signal: %s' % kwargs.get('signal'))
if args[0].debug:
print_tuple(args[1:])
def __peer_if_p2p_property_changed(*args, **kwargs):
- print 'Peer - ',
+ print('Peer - ', end=' ')
args[0].__p2p_property_changed(*args, **kwargs)
def __DeviceFound(self, object_path):
@@ -187,31 +187,31 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
del self.peers[object_path]
def __PeerJoined(self, object_path):
- print 'Peer %s joined' % object_path
+ print('Peer %s joined' % object_path)
def __PeerDisconnected(self, object_path):
- print 'Peer %s disconnected' % object_path
+ print('Peer %s disconnected' % object_path)
def __group_if_property_changed(*args, **kwargs):
- print 'Group - ',
+ print('Group - ', end=' ')
args[0].__if_property_changed(*args, **kwargs)
def __group_if_p2p_property_changed(*args, **kwargs):
- print 'Group - ',
+ print('Group - ', end=' ')
args[0].__p2p_property_changed(*args, **kwargs)
def __GroupFinished(self, properties):
- print 'Group running on %s is being removed' % ifname
+ print('Group running on %s is being removed' % ifname)
self.group_obj = self.group_if = self.group_iface_path = None
if self.debug:
print_dict(properties)
def __InvitationResult(self, response):
- print 'Invitation result status: %d ' % response['status']
+ print('Invitation result status: %d ' % response['status'])
- if response.has_key('bssid'):
- print 'bssid: %s' % response['bssid']
+ if 'bssid' in response:
+ print('bssid: %s' % response['bssid'])
if self.debug:
print_dict(response)
@@ -257,11 +257,11 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
def __ServiceDiscoveryResponse(self, response):
peer = response['peer_object']
if peer in self.peers:
- print 'Peer %s has this TLVs:' % (self.peers[peer]['DeviceName'])
- print response['tlvs']
+ print('Peer %s has this TLVs:' % (self.peers[peer]['DeviceName']))
+ print(response['tlvs'])
def __InterfaceAdded(self, path, properties):
- print 'Interface %s Added (%s)' % (properties['Ifname'], path)
+ print('Interface %s Added (%s)' % (properties['Ifname'], path))
if self.debug:
print_dict(properties)
p2p = dbus.Interface(self.bus.get_object(WPA_INTF,
@@ -269,7 +269,7 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
print_dict(p2p.GetAll(WPA_P2P_INTF))
def __InterfaceRemoved(self, path):
- print 'Interface Removed (%s)' % (path)
+ print('Interface Removed (%s)' % (path))
def __listen_if_signals(self):
self.bus.add_signal_receiver(self.__if_property_changed,
@@ -312,7 +312,7 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
p2p_if.Set(WPA_P2P_INTF, 'P2PDeviceConfig',
dbus.Dictionary({ 'DeviceName' : 'ConnManP2P' },
signature='sv'))
- print 'Interface %s: %s' % (iface_name, self.iface_path)
+ print('Interface %s: %s' % (iface_name, self.iface_path))
self.iface_name = iface_name
self.__listen_if_signals()
@@ -342,7 +342,7 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
return
self.wpa.RemoveInterface(self.iface_path)
- print 'Interface %s removed' % self.iface_name
+ print('Interface %s removed' % self.iface_name)
self.__reset()
@checkarg()
@@ -351,7 +351,7 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
return
self.iface.Scan(({ 'Type': 'passive' }))
- print 'Scan started'
+ print('Scan started')
@checkarg()
def quit(self, args = None):
@@ -382,7 +382,7 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
return
for p in self.peers:
- print 'Peer Name=%s' % (self.peers[p]['DeviceName'])
+ print('Peer Name=%s' % (self.peers[p]['DeviceName']))
def __find_peer(self, peer_name, ret_object_path = False):
if len(self.peers) == 0:
@@ -395,7 +395,7 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
break
if not peer:
- print 'No peer found under the name: %s' % peer_name
+ print('No peer found under the name: %s' % peer_name)
p = None
if ret_object_path:
@@ -426,19 +426,19 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
if (peer['groupcapability'] & P2P_GROUP_CAPAB_GROUP_OWNER ==
P2P_GROUP_CAPAB_GROUP_OWNER):
- print 'Joining an existing P2P group'
+ print('Joining an existing P2P group')
pin = self.p2p.Connect(({ 'peer' : peer_path,
'wps_method' : 'pbc',
'join' : True,
'go_intent' : 0 }))
else:
- print 'Associating with another P2P device'
+ print('Associating with another P2P device')
pin = self.p2p.Connect(({ 'peer' : peer_path,
'wps_method' : 'pbc',
'join' : False,
'go_intent' : 7 }))
if not pin:
- print 'WPS PIN in use: %s' % pin
+ print('WPS PIN in use: %s' % pin)
@checkarg(nb_args = 1)
def p2p_disconnect(self, args):
@@ -450,7 +450,7 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
return
if not self.group_if:
- print 'Peer %s is not connected' % (peer['DeviceName'])
+ print('Peer %s is not connected' % (peer['DeviceName']))
return
self.group_if.Disconnect()
@@ -496,7 +496,7 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
sd_req.append(dbus.Byte(a))
ref = self.p2p.ServiceDiscoveryRequest(({ 'tlv' : sd_req }))
- print 'Service discovery reference: %s' % ref
+ print('Service discovery reference: %s' % ref)
@checkarg(nb_args = 1)
def p2p_serv_disc_cancel_req(self, args):
@@ -518,7 +518,7 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
service['query'] = args[1]
service['response'] = args[2]
else:
- print 'Unknown service: %s' % args[0]
+ print('Unknown service: %s' % args[0])
return
self.p2p.AddService((service))
@@ -535,7 +535,7 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
elif args[0] == 'bonjour':
service['query'] = args[1]
else:
- print 'Unknown service: %s' % args[0]
+ print('Unknown service: %s' % args[0])
return
self.p2p.DeleteService((service))
@@ -593,16 +593,16 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
command['p2p_service_flush'] = {}
command['p2p_invite'] = {ArgFields.help:'<p2p device name>'}
- command_list = command.keys()
+ command_list = list(command.keys())
command_list.sort()
subparsers = parser.add_subparsers(help='commands', dest='command')
subparsers.add_parser('')
for key in command_list:
help=None
metavar=None
- if command[key].has_key(ArgFields.help):
+ if ArgFields.help in command[key]:
help = command[key][ArgFields.help]
- if command[key].has_key(ArgFields.metavar):
+ if ArgFields.metavar in command[key]:
metavar = command[key][ArgFields.metavar]
command_parser = subparsers.add_parser(key, help=help)
command_parser.add_argument(key, nargs='*', metavar=metavar, help=help)
@@ -610,10 +610,6 @@ P2P_GROUP_CAPAB_GROUP_OWNER = 1 << 0
return command
def main():
- if version_info.major != 2:
- print 'You need to run this under Python 2.x'
- exit(1)
-
parser = argparse.ArgumentParser(description='Connman P2P Test')
command_list = build_args(parser)
diff --git a/test/remove-provider b/test/remove-provider
index 39f8de77d040..a2f3e6f44b06 100755
--- a/test/remove-provider
+++ b/test/remove-provider
@@ -4,7 +4,7 @@ import sys
import dbus
if (len(sys.argv) < 2):
- print "Usage: %s <VPN service path> " % (sys.argv[0])
+ print("Usage: %s <VPN service path> " % (sys.argv[0]))
sys.exit(1)
bus = dbus.SystemBus()
@@ -14,6 +14,6 @@ manager = dbus.Interface(bus.get_object("net.connman", "/"),
path = "" + sys.argv[1]
-print "remove path is %s" %(path)
+print("remove path is %s" %(path))
manager.RemoveProvider(sys.argv[1])
diff --git a/test/service-move-before b/test/service-move-before
index d912c88bb211..81526377f012 100755
--- a/test/service-move-before
+++ b/test/service-move-before
@@ -4,7 +4,7 @@ import sys
import dbus
def print_usage():
- print "Usage: %s <service> <target service>" % (sys.argv[0])
+ print("Usage: %s <service> <target service>" % (sys.argv[0]))
if (len(sys.argv) < 2):
@@ -20,8 +20,8 @@ path2 = "/net/connman/service/" + sys.argv[2]
service2 = dbus.Interface(bus.get_object('net.connman', path2),
'net.connman.Service')
-print "Moving %s before %s" % (sys.argv[1], sys.argv[2])
+print("Moving %s before %s" % (sys.argv[1], sys.argv[2]))
service.MoveBefore(service2)
-print
+print()
diff --git a/test/set-clock b/test/set-clock
index a9db3e32f37c..bb443d07a7cd 100755
--- a/test/set-clock
+++ b/test/set-clock
@@ -4,7 +4,7 @@ import sys
import dbus
def print_usage():
- print "Usage: %s TimeUpdates|TimezoneUpdates manual|auto" % (sys.argv[0])
+ print("Usage: %s TimeUpdates|TimezoneUpdates manual|auto" % (sys.argv[0]))
sys.exit(1)
@@ -26,7 +26,7 @@ bus = dbus.SystemBus()
clock = dbus.Interface(bus.get_object('net.connman', '/'),
'net.connman.Clock')
-print "Setting %s to %s" % (sys.argv[1], sys.argv[2])
+print("Setting %s to %s" % (sys.argv[1], sys.argv[2]))
clock.SetProperty(sys.argv[1], make_variant(sys.argv[2]),
signature=dbus.Signature('sv'))
diff --git a/test/set-domains b/test/set-domains
index 87e563e03b8d..ec98c5e3522e 100755
--- a/test/set-domains
+++ b/test/set-domains
@@ -4,7 +4,7 @@ import sys
import dbus
if (len(sys.argv) < 2):
- print "Usage: %s <service> [domain*]" % (sys.argv[0])
+ print("Usage: %s <service> [domain*]" % (sys.argv[0]))
sys.exit(1)
bus = dbus.SystemBus()
@@ -14,7 +14,7 @@ service = dbus.Interface(bus.get_object('net.connman', path),
properties = service.GetProperties()
-print "Setting domains to %s" % (sys.argv[2:])
+print("Setting domains to %s" % (sys.argv[2:]))
service.SetProperty("Domains.Configuration",
dbus.Array(sys.argv[2:], signature=dbus.Signature('s')))
diff --git a/test/set-global-timeservers b/test/set-global-timeservers
index d7551a110b3c..1489ec7181f7 100755
--- a/test/set-global-timeservers
+++ b/test/set-global-timeservers
@@ -4,7 +4,7 @@ import sys
import dbus
if (len(sys.argv) < 1):
- print "Usage: %s [timeserver*]" % (sys.argv[0])
+ print("Usage: %s [timeserver*]" % (sys.argv[0]))
sys.exit(1)
bus = dbus.SystemBus()
@@ -12,7 +12,7 @@ bus = dbus.SystemBus()
clock = dbus.Interface(bus.get_object('net.connman', '/'),
'net.connman.Clock')
-print "Setting timeserver to %s" % (sys.argv[1:])
+print("Setting timeserver to %s" % (sys.argv[1:]))
clock.SetProperty("Timeservers", dbus.Array(sys.argv[1:],
signature=dbus.Signature('s')))
diff --git a/test/set-ipv4-method b/test/set-ipv4-method
index 235113fe0e28..09c194d7c038 100755
--- a/test/set-ipv4-method
+++ b/test/set-ipv4-method
@@ -7,7 +7,7 @@ import dbus
return dbus.String(string, variant_level=1)
def print_usage():
- print "Usage: %s <service> [off|dhcp|manual <address> [netmask] [gateway]]" % (sys.argv[0])
+ print("Usage: %s <service> [off|dhcp|manual <address> [netmask] [gateway]]" % (sys.argv[0]))
if (len(sys.argv) < 3):
@@ -21,7 +21,7 @@ service = dbus.Interface(bus.get_object('net.connman', path),
properties = service.GetProperties()
-print "Setting method %s for %s" % (sys.argv[2], sys.argv[1])
+print("Setting method %s for %s" % (sys.argv[2], sys.argv[1]))
ipv4_configuration = { "Method": make_variant(sys.argv[2]) }
if (len(sys.argv) > 3):
@@ -32,6 +32,6 @@ ipv4_configuration = { "Method": make_variant(sys.argv[2]) }
ipv4_configuration["Gateway"] = make_variant(sys.argv[5])
service.SetProperty("IPv4.Configuration", ipv4_configuration)
-print "New IPv4.Configuration: ", ipv4_configuration
+print("New IPv4.Configuration: ", ipv4_configuration)
-print
+print()
diff --git a/test/set-ipv6-method b/test/set-ipv6-method
index eb1f1b5b5fe4..5536e6f0eabe 100755
--- a/test/set-ipv6-method
+++ b/test/set-ipv6-method
@@ -10,7 +10,7 @@ import dbus
return dbus.Byte(int(string), variant_level=1)
def print_usage():
- print "Usage: %s <service> off|manual|auto [<address> [prefixlen] [gateway]] [<privacy>]" % (sys.argv[0])
+ print("Usage: %s <service> off|manual|auto [<address> [prefixlen] [gateway]] [<privacy>]" % (sys.argv[0]))
if (len(sys.argv) < 3):
print_usage()
@@ -23,7 +23,7 @@ service = dbus.Interface(bus.get_object('net.connman', path),
properties = service.GetProperties()
-print "Setting method %s for %s" % (sys.argv[2], sys.argv[1])
+print("Setting method %s for %s" % (sys.argv[2], sys.argv[1]))
ipv6_configuration = { "Method": make_variant(sys.argv[2])}
if sys.argv[2] == "auto":
@@ -38,6 +38,6 @@ ipv6_configuration = { "Method": make_variant(sys.argv[2])}
ipv6_configuration["Gateway"] = make_variant(sys.argv[5])
service.SetProperty("IPv6.Configuration", ipv6_configuration)
-print "New IPv6.Configuration: ", ipv6_configuration
+print("New IPv6.Configuration: ", ipv6_configuration)
-print
+print()
diff --git a/test/set-nameservers b/test/set-nameservers
index ece69b874fd9..584df7eac18e 100755
--- a/test/set-nameservers
+++ b/test/set-nameservers
@@ -4,7 +4,7 @@ import sys
import dbus
if (len(sys.argv) < 2):
- print "Usage: %s <service> [nameserver*]" % (sys.argv[0])
+ print("Usage: %s <service> [nameserver*]" % (sys.argv[0]))
sys.exit(1)
bus = dbus.SystemBus()
@@ -14,7 +14,7 @@ service = dbus.Interface(bus.get_object('net.connman', path),
properties = service.GetProperties()
-print "Setting nameserver to %s" % (sys.argv[2:])
+print("Setting nameserver to %s" % (sys.argv[2:]))
service.SetProperty("Nameservers.Configuration",
dbus.Array(sys.argv[2:], signature=dbus.Signature('s')))
diff --git a/test/set-proxy b/test/set-proxy
index b9da7b092a2b..f308d327838e 100755
--- a/test/set-proxy
+++ b/test/set-proxy
@@ -4,12 +4,12 @@ import sys
import dbus
if (len(sys.argv) < 2):
- print "Usage:"
- print "%s <service> direct" % (sys.argv[0])
- print "%s <service> manual [servers=uri1,uri2,...] [excludes=host1,host2,...]" % (sys.argv[0])
- print "%s <service> auto url=[pac-url]" % (sys.argv[0])
- print "Example: %s service0 manual servers=proxy.example.com:8080" % sys.argv[0]
- print " This would set the proxy uri and the method to manual"
+ print("Usage:")
+ print("%s <service> direct" % (sys.argv[0]))
+ print("%s <service> manual [servers=uri1,uri2,...] [excludes=host1,host2,...]" % (sys.argv[0]))
+ print("%s <service> auto url=[pac-url]" % (sys.argv[0]))
+ print("Example: %s service0 manual servers=proxy.example.com:8080" % sys.argv[0])
+ print(" This would set the proxy uri and the method to manual")
sys.exit(1)
bus = dbus.SystemBus()
@@ -40,5 +40,5 @@ properties = service.GetProperties()
try:
service.SetProperty("Proxy.Configuration", dbus.Dictionary(values, signature='sv'))
-except dbus.exceptions.DBusException, e_msg:
- print e_msg
+except dbus.exceptions.DBusException as e_msg:
+ print(e_msg)
diff --git a/test/set-timeservers b/test/set-timeservers
index 19cc938975b6..55a1984addcb 100755
--- a/test/set-timeservers
+++ b/test/set-timeservers
@@ -4,7 +4,7 @@ import sys
import dbus
if (len(sys.argv) < 2):
- print "Usage: %s <service> [timeserver*]" % (sys.argv[0])
+ print("Usage: %s <service> [timeserver*]" % (sys.argv[0]))
sys.exit(1)
bus = dbus.SystemBus()
@@ -14,7 +14,7 @@ service = dbus.Interface(bus.get_object('net.connman', path),
properties = service.GetProperties()
-print "Setting timeserver to %s" % (sys.argv[2:])
+print("Setting timeserver to %s" % (sys.argv[2:]))
service.SetProperty("Timeservers.Configuration",
dbus.Array(sys.argv[2:], signature=dbus.Signature('s')))
diff --git a/test/set-timezone b/test/set-timezone
index dfc1c981a35f..4808bd8705b6 100755
--- a/test/set-timezone
+++ b/test/set-timezone
@@ -4,7 +4,7 @@ import sys
import dbus
if (len(sys.argv) != 2):
- print "Usage: %s <timezone>" % (sys.argv[0])
+ print("Usage: %s <timezone>" % (sys.argv[0]))
sys.exit(1)
bus = dbus.SystemBus()
@@ -12,10 +12,10 @@ bus = dbus.SystemBus()
clock = dbus.Interface(bus.get_object('net.connman', '/'),
'net.connman.Clock')
-print "Setting timezone to %s" % (sys.argv[1])
+print("Setting timezone to %s" % (sys.argv[1]))
try:
clock.SetProperty("Timezone", dbus.String(sys.argv[1], variant_level=1),
signature=dbus.Signature('sv'))
-except dbus.exceptions.DBusException, e_msg:
- print e_msg
+except dbus.exceptions.DBusException as e_msg:
+ print(e_msg)
diff --git a/test/show-introspection b/test/show-introspection
index 4b6450f0d0e2..983b36fe5cf1 100755
--- a/test/show-introspection
+++ b/test/show-introspection
@@ -7,7 +7,7 @@ bus = dbus.SystemBus()
object = dbus.Interface(bus.get_object("net.connman", '/'),
"org.freedesktop.DBus.Introspectable")
-print object.Introspect()
+print(object.Introspect())
manager = dbus.Interface(bus.get_object("net.connman", "/"),
"net.connman.Manager")
@@ -18,4 +18,4 @@ technologies = manager.GetTechnologies()
object = dbus.Interface(bus.get_object("net.connman", path),
"org.freedesktop.DBus.Introspectable")
- print object.Introspect()
+ print(object.Introspect())
diff --git a/test/simple-agent b/test/simple-agent
index 01c82baf446e..282785e23d34 100755
--- a/test/simple-agent
+++ b/test/simple-agent
@@ -32,8 +32,8 @@ import sys
response = {}
if not self.identity and not self.passphrase and not self.wpspin:
- print "Service credentials requested, type cancel to cancel"
- args = raw_input('Answer: ')
+ print("Service credentials requested, type cancel to cancel")
+ args = input('Answer: ')
for arg in args.split():
if arg.startswith("cancel"):
@@ -62,9 +62,9 @@ import sys
response = {}
if not self.username and not self.password:
- print "User login requested, type cancel to cancel"
- print "or browser to login through the browser by yourself."
- args = raw_input('Answer: ')
+ print("User login requested, type cancel to cancel")
+ print("or browser to login through the browser by yourself.")
+ args = input('Answer: ')
for arg in args.split():
if arg.startswith("cancel") or arg.startswith("browser"):
@@ -87,7 +87,7 @@ import sys
response = {}
if not self.name and not self.ssid:
- args = raw_input('Answer ')
+ args = input('Answer ')
for arg in args.split():
if arg.startswith("Name="):
@@ -110,18 +110,18 @@ import sys
in_signature='oa{sv}',
out_signature='a{sv}')
def RequestInput(self, path, fields):
- print "RequestInput (%s,%s)" % (path, fields)
+ print("RequestInput (%s,%s)" % (path, fields))
response = {}
- if fields.has_key("Name"):
+ if "Name" in fields:
response.update(self.input_hidden())
- if fields.has_key("Passphrase"):
+ if "Passphrase" in fields:
response.update(self.input_passphrase())
- if fields.has_key("Username"):
+ if "Username" in fields:
response.update(self.input_username())
- if response.has_key("Error"):
+ if "Error" in response:
if response["Error"] == "cancel":
raise Canceled("canceled")
return
@@ -129,7 +129,7 @@ import sys
raise LaunchBrowser("launch browser")
return
- print "returning (%s)" % (response)
+ print("returning (%s)" % (response))
return response
@@ -137,12 +137,12 @@ import sys
in_signature='os',
out_signature='')
def RequestBrowser(self, path, url):
- print "RequestBrowser (%s,%s)" % (path, url)
+ print("RequestBrowser (%s,%s)" % (path, url))
- print "Please login through the given url in a browser"
- print "Then press enter to accept or some text to cancel"
+ print("Please login through the given url in a browser")
+ print("Then press enter to accept or some text to cancel")
- args = raw_input('> ')
+ args = input('> ')
if len(args) > 0:
raise Canceled("canceled")
@@ -153,8 +153,8 @@ import sys
in_signature='os',
out_signature='')
def ReportError(self, path, error):
- print "ReportError %s, %s" % (path, error)
- retry = raw_input("Retry service (yes/no): ")
+ print("ReportError %s, %s" % (path, error))
+ retry = input("Retry service (yes/no): ")
if (retry == "yes"):
class Retry(dbus.DBusException):
_dbus_error_name = "net.connman.Agent.Error.Retry"
@@ -167,7 +167,7 @@ import sys
@dbus.service.method("net.connman.Agent",
in_signature='', out_signature='')
def Cancel(self):
- print "Cancel"
+ print("Cancel")
class VpnAgent(dbus.service.Object):
name = None
@@ -185,8 +185,8 @@ import sys
response = {}
if not self.cookie:
- print "VPN credentials requested, type cancel to cancel"
- args = raw_input('Answer: ')
+ print("VPN credentials requested, type cancel to cancel")
+ args = input('Answer: ')
for arg in args.split():
if arg.startswith("cancel"):
@@ -204,8 +204,8 @@ import sys
response = {}
if not self.username and not self.password:
- print "User login requested, type cancel to cancel"
- args = raw_input('Answer: ')
+ print("User login requested, type cancel to cancel")
+ args = input('Answer: ')
for arg in args.split():
if arg.startswith("cancel"):
@@ -228,21 +228,21 @@ import sys
in_signature='oa{sv}',
out_signature='a{sv}')
def RequestInput(self, path, fields):
- print "RequestInput (%s,%s)" % (path, fields)
+ print("RequestInput (%s,%s)" % (path, fields))
response = {}
- if fields.has_key("OpenConnect.Cookie"):
+ if "OpenConnect.Cookie" in fields:
response.update(self.input_cookie())
- if fields.has_key("Username") or fields.has_key("Password"):
+ if "Username" in fields or "Password" in fields:
response.update(self.input_username())
- if response.has_key("Error"):
+ if "Error" in response:
if response["Error"] == "cancel":
raise Canceled("canceled")
return
- print "returning (%s)" % (response)
+ print("returning (%s)" % (response))
return response
@@ -250,8 +250,8 @@ import sys
in_signature='os',
out_signature='')
def ReportError(self, path, error):
- print "ReportError %s, %s" % (path, error)
- retry = raw_input("Retry service (yes/no): ")
+ print("ReportError %s, %s" % (path, error))
+ retry = input("Retry service (yes/no): ")
if (retry == "yes"):
class Retry(dbus.DBusException):
_dbus_error_name = "net.connman.vpn.Agent.Error.Retry"
@@ -264,7 +264,7 @@ import sys
@dbus.service.method("net.connman.vpn.Agent",
in_signature='', out_signature='')
def Cancel(self):
- print "Cancel"
+ print("Cancel")
def vpnNameOwnerChanged(proxy):
if proxy:
@@ -276,22 +276,22 @@ import sys
'net.connman.vpn.Manager')
vpn_manager.RegisterAgent(path)
except:
- print "vpn agent is not registered"
+ print("vpn agent is not registered")
else:
print("vpnd is disconnected from system bus")
vpn_manager = None
def print_usage():
- print "Usage:"
- print "For hidden service:"
- print "%s Name=<hidden service name> [SSID=<hidden ssid>]" % (sys.argv[0])
- print "For EAP/WPA input:"
- print "%s Identity=<identity> Passphrase=<passphrase> WPS=<wpspin>" % (sys.argv[0])
- print "For WISPr login, L2TP or PPTP input:"
- print "%s Username=<username> Password=<password>" % (sys.argv[0])
- print "For OpenConnect input:"
- print "%s Cookie=<string>" % (sys.argv[0])
- print "Help: %s help" % (sys.argv[0])
+ print("Usage:")
+ print("For hidden service:")
+ print("%s Name=<hidden service name> [SSID=<hidden ssid>]" % (sys.argv[0]))
+ print("For EAP/WPA input:")
+ print("%s Identity=<identity> Passphrase=<passphrase> WPS=<wpspin>" % (sys.argv[0]))
+ print("For WISPr login, L2TP or PPTP input:")
+ print("%s Username=<username> Password=<password>" % (sys.argv[0]))
+ print("For OpenConnect input:")
+ print("%s Cookie=<string>" % (sys.argv[0]))
+ print("Help: %s help" % (sys.argv[0]))
sys.exit(1)
if __name__ == '__main__':
@@ -314,7 +314,7 @@ import sys
vpn_object = VpnAgent(bus, vpn_path)
except:
vpn_manager = None
- print "net.connman.vpn is not present"
+ print("net.connman.vpn is not present")
if len(sys.argv) >= 2:
for arg in sys.argv[1:]:
@@ -342,7 +342,7 @@ import sys
try:
manager.RegisterAgent(path)
except:
- print "Cannot register connman agent."
+ print("Cannot register connman agent.")
if vpn_manager != None:
try:
diff --git a/test/test-clock b/test/test-clock
index e9b76fca3ee0..c086ffc67054 100755
--- a/test/test-clock
+++ b/test/test-clock
@@ -9,11 +9,11 @@ clock = dbus.Interface(bus.get_object("net.connman", "/"),
properties = clock.GetProperties()
-for key in properties.keys():
+for key in list(properties.keys()):
if key in ["Timeservers"]:
list = ""
for val in properties[key]:
list = list + val + " "
- print "%s = [ %s]" % (key, list)
+ print("%s = [ %s]" % (key, list))
else:
- print "%s = %s" % (key, properties[key])
+ print("%s = %s" % (key, properties[key]))
diff --git a/test/test-compat b/test/test-compat
index cd1ca7a79dcc..c9cdbab3e4f1 100755
--- a/test/test-compat
+++ b/test/test-compat
@@ -12,4 +12,4 @@ states = [ "unknown", "asleep", "connecting", "connected", "disconnected" ]
state = manager.state()
-print "System is %s" % (states[state])
+print("System is %s" % (states[state]))
diff --git a/test/test-connman b/test/test-connman
index d047c86d5a7f..45a18d97f967 100755
--- a/test/test-connman
+++ b/test/test-connman
@@ -9,19 +9,19 @@ manager = dbus.Interface(bus.get_object("net.connman", "/"),
"net.connman.Manager")
if len(sys.argv) < 2:
- print "Usage: %s <command>" % (sys.argv[0])
- print ""
- print " state"
- print " services"
- print " autoconnect <service> [autoconnect]"
- print " connect <service>"
- print " disconnect <service>"
- print " remove <service>"
- print ""
- print " scan <type>"
- print " enable <type>"
- print " disable <type>"
- print " offlinemode [on|off]"
+ print("Usage: %s <command>" % (sys.argv[0]))
+ print("")
+ print(" state")
+ print(" services")
+ print(" autoconnect <service> [autoconnect]")
+ print(" connect <service>")
+ print(" disconnect <service>")
+ print(" remove <service>")
+ print("")
+ print(" scan <type>")
+ print(" enable <type>")
+ print(" disable <type>")
+ print(" offlinemode [on|off]")
sys.exit(1)
def print_services(services):
@@ -45,25 +45,25 @@ manager = dbus.Interface(bus.get_object("net.connman", "/"),
else:
favorite = " "
- if "Name" in properties.keys():
+ if "Name" in list(properties.keys()):
name = properties["Name"]
else:
name = "{" + properties["Type"] + "}"
- print "%s%s%s %-26s { %s }" % (favorite, autoconnect, state,
- name, identifier)
+ print("%s%s%s %-26s { %s }" % (favorite, autoconnect, state,
+ name, identifier))
if sys.argv[1] == "state":
properties = manager.GetProperties()
- print "System is %s" % (properties["State"])
+ print("System is %s" % (properties["State"]))
elif sys.argv[1] in ["services", "list", "show"]:
print_services(manager.GetServices())
elif sys.argv[1] in ["autoconnect", "autoconn"]:
if (len(sys.argv) < 3):
- print "Need at least service parameter"
+ print("Need at least service parameter")
sys.exit(1)
path = "/net/connman/service/" + sys.argv[2]
@@ -77,25 +77,25 @@ manager = dbus.Interface(bus.get_object("net.connman", "/"),
service.SetProperty("AutoConnect", autoconnect);
- print "Auto connect %s for %s" % (autoconnect, sys.argv[2])
+ print("Auto connect %s for %s" % (autoconnect, sys.argv[2]))
else:
properties = service.GetProperties()
- if "Name" in properties.keys():
+ if "Name" in list(properties.keys()):
name = properties["Name"]
else:
name = "{" + properties["Type"] + "}"
- if "AutoConnect" in properties.keys():
+ if "AutoConnect" in list(properties.keys()):
autoconnect = properties["AutoConnect"]
else:
autoconnect = dbus.Boolean(0)
- print "Auto connect %s for %s" % (autoconnect, name)
+ print("Auto connect %s for %s" % (autoconnect, name))
elif sys.argv[1] in ["connect", "conn"]:
if (len(sys.argv) < 3):
- print "Need at least service parameter"
+ print("Need at least service parameter")
sys.exit(1)
path = "/net/connman/service/" + sys.argv[2]
@@ -105,12 +105,12 @@ manager = dbus.Interface(bus.get_object("net.connman", "/"),
try:
service.Connect(timeout=60000)
- except dbus.DBusException, error:
- print "%s: %s" % (error._dbus_error_name, error.message)
+ except dbus.DBusException as error:
+ print("%s: %s" % (error._dbus_error_name, error.message))
elif sys.argv[1] in ["disconnect", "disc"]:
if (len(sys.argv) < 3):
- print "Need at least service parameter"
+ print("Need at least service parameter")
sys.exit(1)
path = "/net/connman/service/" + sys.argv[2]
@@ -120,12 +120,12 @@ manager = dbus.Interface(bus.get_object("net.connman", "/"),
try:
service.Disconnect()
- except dbus.DBusException, error:
- print "%s: %s" % (error._dbus_error_name, error.message)
+ except dbus.DBusException as error:
+ print("%s: %s" % (error._dbus_error_name, error.message))
elif sys.argv[1] in ["remove"]:
if (len(sys.argv) < 3):
- print "Need at least service parameter"
+ print("Need at least service parameter")
sys.exit(1)
path = "/net/connman/service/" + sys.argv[2]
@@ -136,13 +136,13 @@ manager = dbus.Interface(bus.get_object("net.connman", "/"),
properties = service.GetProperties()
if properties["Favorite"] == dbus.Boolean(0):
- print "Only favorite services can be removed"
+ print("Only favorite services can be removed")
sys.exit(1)
try:
service.Remove()
- except dbus.DBusException, error:
- print "%s: %s" % (error._dbus_error_name, error.message)
+ except dbus.DBusException as error:
+ print("%s: %s" % (error._dbus_error_name, error.message))
elif sys.argv[1] == "scan":
if len(sys.argv) == 3:
@@ -151,7 +151,7 @@ manager = dbus.Interface(bus.get_object("net.connman", "/"),
"net.connman.Technology")
technology.Scan()
else:
- print "'%s' takes two arguments" % sys.argv[1]
+ print("'%s' takes two arguments" % sys.argv[1])
elif sys.argv[1] == "enable":
if len(sys.argv) == 3:
@@ -160,7 +160,7 @@ manager = dbus.Interface(bus.get_object("net.connman", "/"),
"net.connman.Technology")
technology.SetProperty("Powered", True)
else:
- print "'%s' takes two arguments" % sys.argv[1]
+ print("'%s' takes two arguments" % sys.argv[1])
elif sys.argv[1] == "disable":
if len(sys.argv) == 3:
@@ -169,7 +169,7 @@ manager = dbus.Interface(bus.get_object("net.connman", "/"),
"net.connman.Technology")
technology.SetProperty("Powered", False)
else:
- print "'%s' takes two arguments" % sys.argv[1]
+ print("'%s' takes two arguments" % sys.argv[1])
elif sys.argv[1] in ["offlinemode", "flightmode"]:
@@ -179,15 +179,15 @@ manager = dbus.Interface(bus.get_object("net.connman", "/"),
elif sys.argv[2] == "off" or sys.argv[2] == "0" or sys.argv[2] == "no":
active = dbus.Boolean(0)
else:
- print "Use either 'on', '1', 'yes', 'off', '0' or 'no'"
+ print("Use either 'on', '1', 'yes', 'off', '0' or 'no'")
exit()
manager.SetProperty("OfflineMode", active)
elif len(sys.argv) == 2:
properties = manager.GetProperties()
- print "Offline mode is %s" % (properties["OfflineMode"])
+ print("Offline mode is %s" % (properties["OfflineMode"]))
else:
- print "'%s' takes max. two arguments" % sys.argv[1]
+ print("'%s' takes max. two arguments" % sys.argv[1])
else:
- print "Unknown command"
+ print("Unknown command")
diff --git a/test/test-counter b/test/test-counter
index ce8358020f89..c09aabc12b4b 100755
--- a/test/test-counter
+++ b/test/test-counter
@@ -24,7 +24,7 @@ import dbus.mainloop.glib
return ''
def print_stats(stats):
- keys = stats.keys()
+ keys = list(stats.keys())
keys.sort()
for key in keys:
@@ -36,7 +36,7 @@ import dbus.mainloop.glib
if hstr:
str = "%s (%s)" % (str, hstr)
- print str
+ print(str)
class Counter(dbus.service.Object):
@dbus.service.method("net.connman.Counter",
@@ -48,13 +48,13 @@ import dbus.mainloop.glib
@dbus.service.method("net.connman.Counter",
in_signature='oa{sv}a{sv}', out_signature='')
def Usage(self, path, home, roaming):
- print "%s" % (path)
+ print("%s" % (path))
if len(home) > 0:
- print " Home"
+ print(" Home")
print_stats(home)
if len(roaming) > 0:
- print " Roaming"
+ print(" Roaming")
print_stats(roaming)
if __name__ == '__main__':
diff --git a/test/test-manager b/test/test-manager
index 2b4493c5c2ed..2bc53acc3c77 100755
--- a/test/test-manager
+++ b/test/test-manager
@@ -4,7 +4,7 @@ import dbus
def extract_values(values):
val = "{"
- for key in values.keys():
+ for key in list(values.keys()):
val += " " + key + "="
if key in ["PrefixLength"]:
val += "%s" % (int(values[key]))
@@ -30,23 +30,23 @@ manager = dbus.Interface(bus.get_object("net.connman", "/"),
properties = manager.GetProperties()
-for key in properties.keys():
+for key in list(properties.keys()):
if key in ["OfflineMode", "SessionMode"]:
- print "%s" % (key)
+ print("%s" % (key))
if properties[key] == dbus.Boolean(1):
- print " true"
+ print(" true")
else:
- print " false"
+ print(" false")
else:
- print "%s" % (key)
- print " %s" % (properties[key])
+ print("%s" % (key))
+ print(" %s" % (properties[key]))
print ("Services")
services = manager.GetServices()
for (path, properties) in services:
- print " %s" % (path)
- for key in properties.keys():
+ print(" %s" % (path))
+ for key in list(properties.keys()):
if key in ["Available", "Remember", "Default",
"Favorite", "Immutable", "AutoConnect",
"LoginRequired",
@@ -73,14 +73,14 @@ services = manager.GetServices()
else:
val = str(properties[key])
- print " %s = %s" % (key, val)
+ print(" %s = %s" % (key, val))
print ("Technologies")
technologies = manager.GetTechnologies()
for (path, properties) in technologies:
- print " %s" % (path)
- for key in properties.keys():
+ print(" %s" % (path))
+ for key in list(properties.keys()):
if key in ["Connected", "Powered", "Tethering"]:
if properties[key] == dbus.Boolean(1):
@@ -90,4 +90,4 @@ technologies = manager.GetTechnologies()
else:
val = properties[key]
- print " %s = %s" % (key, val)
+ print(" %s = %s" % (key, val))
diff --git a/test/test-new-supplicant b/test/test-new-supplicant
index be230dc4de37..face13088831 100755
--- a/test/test-new-supplicant
+++ b/test/test-new-supplicant
@@ -11,4 +11,4 @@ bus = dbus.SystemBus()
dummy = dbus.Interface(bus.get_object(WPA_NAME, WPA_PATH),
'org.freedesktop.DBus.Introspectable')
-print dummy.Introspect()
+print(dummy.Introspect())
diff --git a/test/test-session b/test/test-session
index 2d82fb65ea12..67bc4460d658 100755
--- a/test/test-session
+++ b/test/test-session
@@ -21,7 +21,7 @@ import traceback
def extract_values(values):
val = "{"
- for key in values.keys():
+ for key in list(values.keys()):
val += " " + key + "="
if key in ["PrefixLength"]:
val += "%s" % (int(values[key]))
@@ -41,26 +41,26 @@ import traceback
@dbus.service.method("net.connman.Notification",
in_signature='', out_signature='')
def Release(self):
- print "Release %s" % (self._object_path)
+ print("Release %s" % (self._object_path))
session_name = self._object_path.split('/')[-1]
self.app.release(session_name)
@dbus.service.method("net.connman.Notification",
in_signature='a{sv}', out_signature='')
def Update(self, settings):
- print "Update called at %s" % (self._object_path)
+ print("Update called at %s" % (self._object_path))
try:
- for key in settings.keys():
+ for key in list(settings.keys()):
if key in ["IPv4", "IPv6"]:
val = extract_values(settings[key])
elif key in ["AllowedBearers"]:
val = extract_list(settings[key])
else:
val = settings[key]
- print " %s = %s" % (key, val)
+ print(" %s = %s" % (key, val))
except:
- print "Exception:"
+ print("Exception:")
traceback.print_exc()
class SessionApplication(dbus.service.Object):
@@ -80,15 +80,15 @@ import traceback
def connman_name_owner_changed(self, proxy):
try:
if proxy:
- print "connman appeared on D-Bus ", str(proxy)
+ print("connman appeared on D-Bus ", str(proxy))
bus = dbus.SystemBus()
self.manager = dbus.Interface(bus.get_object("net.connman", "/"),
"net.connman.Manager")
else:
- print "connman disappeared on D-Bus"
+ print("connman disappeared on D-Bus")
self.manager = None
- for s in self.sessions.keys():
+ for s in list(self.sessions.keys()):
self.sessions[s]['notify'].remove_from_connection()
self.sessions[s]['notify'] = None
@@ -127,18 +127,18 @@ import traceback
return value
def find_session(self, session_name):
- if not session_name in self.sessions.keys():
+ if not session_name in list(self.sessions.keys()):
return None
return self.sessions[session_name]
@dbus.service.method("com.example.TestSession",
in_signature='', out_signature='')
def CreateSession(self, session_name):
- print "Create session"
+ print("Create session")
s = self.find_session(session_name)
if s and s['session'] :
- print "Session %s already created-> drop reqest" % (session_name)
+ print("Session %s already created-> drop reqest" % (session_name))
return
try:
@@ -149,29 +149,29 @@ import traceback
s['notify_path'] = self._object_path + "/" + session_name
s['notify'] = Notification(bus, self, s['notify_path'])
s['notify'].add_to_connection(bus, s['notify_path'])
- if not 'settings' in s.keys():
+ if not 'settings' in list(s.keys()):
s['settings'] = {};
s['session_path'] = self.manager.CreateSession(s['settings'], s['notify_path'])
- print "notify path %s" % (s['notify_path'])
- print "session path %s" % (s['session_path'])
+ print("notify path %s" % (s['notify_path']))
+ print("session path %s" % (s['session_path']))
s['session'] = dbus.Interface(bus.get_object("net.connman", s['session_path']),
"net.connman.Session")
self.sessions[session_name] = s
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
if e.get_dbus_name() in ['net.connman.Error.Failed']:
- print e.get_dbus_message()
+ print(e.get_dbus_message())
return
traceback.print_exc()
@dbus.service.method("com.example.TestSession",
in_signature='', out_signature='')
def DestroySession(self, session_name):
- print "Destroy session"
+ print("Destroy session")
s = self.find_session(session_name)
if s == None or s['session'] == None:
- print "The session is not running -> drop request"
+ print("The session is not running -> drop request")
return
try:
@@ -182,92 +182,92 @@ import traceback
@dbus.service.method("com.example.TestSession",
in_signature='', out_signature='')
def Connect(self, session_name):
- print "Connect session"
+ print("Connect session")
s = self.find_session(session_name)
if s == None or s['session'] == None:
- print "The session is not running -> drop request"
+ print("The session is not running -> drop request")
return
try:
s['session'].Connect()
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
if e.get_dbus_name() in ['net.connman.Error.Failed']:
- print e.get_dbus_message()
+ print(e.get_dbus_message())
return
traceback.print_exc()
@dbus.service.method("com.example.TestSession",
in_signature='', out_signature='')
def Disconnect(self, session_name):
- print "Disconnect session"
+ print("Disconnect session")
s = self.find_session(session_name)
if s == None or s['session'] == None:
- print "The session is not running -> drop request"
+ print("The session is not running -> drop request")
return
try:
s['session'].Disconnect()
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
if e.get_dbus_name() in ['net.connman.Error.Failed']:
- print e.get_dbus_message()
+ print(e.get_dbus_message())
return
traceback.print_exc()
@dbus.service.method("com.example.TestSession",
in_signature='', out_signature='')
def Change(self, session_name, key, value):
- print "Update session settings"
+ print("Update session settings")
s = self.find_session(session_name)
if s == None or s['session'] == None:
- print "The session is not running -> drop request"
+ print("The session is not running -> drop request")
return
try:
val = self.type_convert(key, value)
s['session'].Change(key, val)
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
if e.get_dbus_name() in ['net.connman.Error.Failed']:
- print e.get_dbus_message()
+ print(e.get_dbus_message())
return
traceback.print_exc()
@dbus.service.method("com.example.TestSession",
in_signature='', out_signature='')
def Configure(self, session_name, key, value):
- print "Configure session settings"
+ print("Configure session settings")
s = self.find_session(session_name)
if s == None:
s = {}
s['notify_path'] = None
s['notify'] = None
- if not 'settings' in s.keys():
+ if not 'settings' in list(s.keys()):
s['settings'] = {};
s['session_path'] = None
s['session'] = None
self.sessions[session_name] = s
if s and s['session']:
- print "The session is running, use change -> drop request"
+ print("The session is running, use change -> drop request")
return
val = self.type_convert(key, value)
s['settings'][key] = val
def main():
if len(sys.argv) < 2:
- print "Usage: %s <command>" % (sys.argv[0])
- print ""
- print " enable"
- print " disable"
- print " create <app_path> <session_name>"
- print " destroy <app_path> <session_name>"
- print " connect <app_path> <session_name>"
- print " disconnect <app_path> <session_name>"
- print " change <app_path> <session_name> <key> <value>"
- print " configure <app_path> <session_name> <key> <value>"
- print ""
- print " run <app_path>"
+ print("Usage: %s <command>" % (sys.argv[0]))
+ print("")
+ print(" enable")
+ print(" disable")
+ print(" create <app_path> <session_name>")
+ print(" destroy <app_path> <session_name>")
+ print(" connect <app_path> <session_name>")
+ print(" disconnect <app_path> <session_name>")
+ print(" change <app_path> <session_name> <key> <value>")
+ print(" configure <app_path> <session_name> <key> <value>")
+ print("")
+ print(" run <app_path>")
sys.exit(1)
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
@@ -287,7 +287,7 @@ import traceback
return
if (len(sys.argv) < 3):
- print "Need test application path"
+ print("Need test application path")
sys.exit(1)
app_path = sys.argv[2]
@@ -321,20 +321,20 @@ import traceback
elif sys.argv[1] == "change":
if len(sys.argv) < 5:
- print "Arguments missing"
+ print("Arguments missing")
sys.exit(1)
app.Change(sys.argv[3], sys.argv[4], sys.argv[5:])
elif sys.argv[1] == "configure":
if len(sys.argv) < 5:
- print "Arguments missing"
+ print("Arguments missing")
sys.exit(1)
app.Configure(sys.argv[3], sys.argv[4], sys.argv[5:])
else:
- print "Unknown command '%s'" % sys.argv[1]
+ print("Unknown command '%s'" % sys.argv[1])
sys.exit(1)
if __name__ == '__main__':
diff --git a/test/vpn-connect b/test/vpn-connect
index 0f8636daf6a0..29753dc8a875 100755
--- a/test/vpn-connect
+++ b/test/vpn-connect
@@ -4,7 +4,7 @@ import sys
import dbus
if (len(sys.argv) < 2):
- print "Usage: %s <VPN connection id>" % (sys.argv[0])
+ print("Usage: %s <VPN connection id>" % (sys.argv[0]))
sys.exit(1)
bus = dbus.SystemBus()
@@ -16,7 +16,7 @@ connections = manager.GetConnections()
path = "/net/connman/vpn/connection/" + sys.argv[1]
-print "Attempting to connect VPN %s" % (path)
+print("Attempting to connect VPN %s" % (path))
connection = dbus.Interface(bus.get_object("net.connman.vpn", path),
"net.connman.vpn.Connection")
diff --git a/test/vpn-disconnect b/test/vpn-disconnect
index d7a49ba958be..dccad2c85906 100755
--- a/test/vpn-disconnect
+++ b/test/vpn-disconnect
@@ -4,7 +4,7 @@ import sys
import dbus
if (len(sys.argv) < 1):
- print "Usage: %s <VPN connection id>" % (sys.argv[0])
+ print("Usage: %s <VPN connection id>" % (sys.argv[0]))
sys.exit(1)
bus = dbus.SystemBus()
@@ -16,7 +16,7 @@ connections = manager.GetConnections()
path = "/net/connman/vpn/connection/" + sys.argv[1]
-print "Attempting to disconnect VPN %s" % (path)
+print("Attempting to disconnect VPN %s" % (path))
connection = dbus.Interface(bus.get_object("net.connman.vpn", path),
"net.connman.vpn.Connection")
diff --git a/test/vpn-get b/test/vpn-get
index f1f760cc3ba2..c9c5a7002ba3 100755
--- a/test/vpn-get
+++ b/test/vpn-get
@@ -4,7 +4,7 @@ import dbus
def extract_values(values):
val = "{"
- for key in values.keys():
+ for key in list(values.keys()):
val += " " + key + "="
if key in ["Servers", "Excludes"]:
val += extract_list(values[key])
@@ -34,15 +34,15 @@ manager = dbus.Interface(bus.get_object('net.connman.vpn', '/'),
path = entry[0]
properties = entry[1]
- print "[ %s ]" % (path)
+ print("[ %s ]" % (path))
- for key in properties.keys():
+ for key in list(properties.keys()):
if key in ["IPv4", "IPv6" ]:
val = extract_values(properties[key])
elif key in ["Nameservers","ServerRoutes","UserRoutes"]:
val = extract_list(properties[key])
else:
val = str(properties[key])
- print " %s = %s" % (key, val)
+ print(" %s = %s" % (key, val))
- print
+ print()
diff --git a/test/vpn-property b/test/vpn-property
index d05f4c7a8c3d..feddb5fcfaeb 100755
--- a/test/vpn-property
+++ b/test/vpn-property
@@ -8,7 +8,7 @@ import dbus
def extract_values(values):
val = "{"
- for key in values.keys():
+ for key in list(values.keys()):
val += " " + key + "="
if key in ["Servers", "Excludes"]:
val += extract_list(values[key])
@@ -32,7 +32,7 @@ import dbus
argc = len(sys.argv)
if (argc < 2):
- print "Usage: %s <VPN connection id> [<property name>] [<property values>]" % (sys.argv[0])
+ print("Usage: %s <VPN connection id> [<property name>] [<property values>]" % (sys.argv[0]))
sys.exit(1)
bus = dbus.SystemBus()
@@ -44,29 +44,29 @@ connections = manager.GetConnections()
path = "/net/connman/vpn/connection/" + sys.argv[1]
-print "Attempting to connect VPN %s" % (path)
+print("Attempting to connect VPN %s" % (path))
connection = dbus.Interface(bus.get_object("net.connman.vpn", path),
"net.connman.vpn.Connection")
if (argc < 3):
properties = connection.GetProperties()
- for key in properties.keys():
+ for key in list(properties.keys()):
if key in ["IPv4", "IPv6" ]:
val = extract_values(properties[key])
elif key in ["Nameservers","ServerRoutes","UserRoutes"]:
val = extract_list(properties[key])
else:
val = str(properties[key])
- print " %s = %s" % (key, val)
+ print(" %s = %s" % (key, val))
elif (argc < 4):
try:
connection.ClearProperty(sys.argv[2])
- except dbus.DBusException, error:
- print "%s: %s" % (error._dbus_error_name, error.message)
+ except dbus.DBusException as error:
+ print("%s: %s" % (error._dbus_error_name, error.message))
else:
try:
connection.SetProperty(sys.argv[2], sys.argv[3])
- except dbus.DBusException, error:
- print "%s: %s" % (error._dbus_error_name, error.message)
+ except dbus.DBusException as error:
+ print("%s: %s" % (error._dbus_error_name, error.message))
--
2.24.0
2 years, 4 months
[PATCH 0/2] Add support to provision MTU
by Daniel Wagner
This is relatively easy to support. I left away the D-Bus interface
for this for now. This would be a bit more of work.
Daniel Wagner (2):
config: Add support to provision MTU
doc: Add provisioning information on MTU
doc/config-format.txt | 7 +++++++
src/config.c | 32 ++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+)
--
2.25.0
2 years, 4 months
[PATCH] mnlg: Define NETLINK socket options
by Daniel Wagner
Older kernel headers are missing definition for NETLINK_CAP_ACK and
NETLINK_EXT_ACK. Add them so that ConnMan can be build on older
kernels as well.
Furthermore, the WireGuard project has been backported to older
kernels such as the LTS v4.4 kernel.
It's far from ideal but those definition don't hurt too much so we add
them here for the time being.
Reported by Christian Hewitt.
---
src/shared/mnlg.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/shared/mnlg.c b/src/shared/mnlg.c
index 6b02059d4490..1399ce40e3d5 100644
--- a/src/shared/mnlg.c
+++ b/src/shared/mnlg.c
@@ -28,6 +28,12 @@
#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
#endif
+#ifndef NETLINK_CAP_ACK
+#define NETLINK_CAP_ACK 10
+#endif
+#ifndef NETLINK_EXT_ACK
+#define NETLINK_EXT_ACK 11
+#endif
struct mnlg_socket {
struct mnl_socket *nl;
--
2.25.0
2 years, 4 months