Existing code has transport memory leaks. Use smart pointers
for transport to get rid of those cases and manual memory
management
Test: atest fastboot_test
Test: manually checked transport isn't leaking anymore
Bug: 296629925
Change-Id: Ifdf162d5084f61ae5c1d2b56a897464af58100da
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
Adding test cases for correct formation of optimized flash super task.
We are adding an explicit pattern match for this task to be correctly
formed. Changing Optimized flash task to only remove the reboot to
userspace as a user might want to reboot back to bootloader after
flashing. We also need to change a couple functions to take a
IFastbootDriver to mock up the initialization path.
Test: fastboot_test
Bug: 297085098
Change-Id: Ic5c63bd4057ca6d64647134e5ce33fef12077fdb
updates the relevant unit tests.
BUG=182864081
Test: Update the size check to the existing unit tests
Change-Id: I66b08884a5228e164c22c575a6f6c82a236fece2
fuzzy_fastboot causes vts to fail when it has isolated set to true
so manually set it to false to avoid this.
Bug: 178498003
Test: Ran tests that failed presubmit
Change-Id: I871854c26e07ac6ad94feb14703b705a3054c176
Add a malformed download command test.
And add a sparse file test with very large block size
Bug: 215236564
Test: bootloader fastboot
Change-Id: I1072ba189ac15b2e1eb8f13ffd754f93c967e2d5
Sparse file can come from an untrusted source.
Need more checking to ensure that it is not a malformed
file and would not cause any OOB read access.
Update fuzz test for decoding also.
Test: adb reboot fastboot
fuzzy_fastboot --gtest_filter=Fuzz.Sparse*
fuzzy_fastboot --gtest_filter=Conformance.Sparse*
sparse_fuzzer
Bug: 212705418
Change-Id: I7622df307bb00e59faaba8bb2c67cb474cffed8e
Device might return I/O error instead of FAIL message
if command send to device is too large.
Since maximum command size in fastboto protocol is 64 bytes.
The device might only try to read 64 bytes for the bulk transfer,
sending data more than that might result in USB I/O error.
Do proper handler for that in fuzzy_fastboot and reset the USB
if I/O error encounter during the Comman.dTooLarge test
Test: adb reboot fastboot
fuzzy_fastboot --gtest_filter=Fuzz.CommandTooLarge
fuzzy_fastboot --gtest_filter=Fuzz.BadCommandTooLarge
Bug: 212628476
Change-Id: I3612e131de02435ee3ed7d18f2b2d20b50ae6c3f
The fuzzy_fastboot does not output error
with invalid command line argument.
Fix typo in README for running with gtest_filter
Bug: 212628476
Test: N/A
Change-Id: I4a67a84807b59db50f063f1b9cf60dc964c1df20
Updating language to comply with Android’s inclusive language guidance.
See https://source.android.com/setup/contribute/respectful-code for reference.
Bug: 161896447
Test: Trivial changes
Change-Id: Ia84d47930b5d9ca4a5f7c809777c886bece4f512
The fastbootd over ethernet was implemented with IPv6 link-local
address. An IPv6 address may include many ':'. It will break this fuzzy
test. This new solution uses "tcp:" prefix to identify the fastboot
protocol, like the host fastboot command.
BUG: 158040108
Test: fuzzy_fastboot --serial=tcp:fe80::230:1bff:feba:8128%wlan0 \
--gtest_filter=*Logical*
Change-Id: I971fd9e25741e18bf7f5907d562556b09db1d624
Bug: 151896491
Test: local build
Exempt-From-Owner-Approval: This CL moves all tests in vts-core to vts.
It won't change test logic or behavior.
Change-Id: I24779951257ce37fc18929f214d3cf5f76c23a19
Merged-In: I24779951257ce37fc18929f214d3cf5f76c23a19
1. delete-logical-partition was deleted
- After merge "Don't require bootloader fastboot for VTS compliance." commit, delete-logical-partition sequence was deleted in LogicalPartitionCompliance test. "create-logical-partition failed" is occurred when run vts fastbootverification module. So restore this sequence.
Signed-off-by: Yongcheol LEE <yongcheol09.lee@lge.com>
Test: VTS
Test: run vts -m VtsFastbootVerification
Change-Id: I00366b281eafa5677b0941419a86f2702fb3484b
This is for the test to run without packaging libc++.so in vts-core
suite.
Bug: 147249791
Test: atest FastbootVerifyUserspaceTest
Change-Id: I0263d13a2dd08186502b30b2fad25d4f0f3a6be8
The binary is required by FastbootVerifyUserspaceTest.
Disable test config generation as fuzzy_fasboot itself is not part of
vts-core suite.
Bug: 147249791
Test: atest FastbootVerifyUserspaceTest
Change-Id: Ief86f33b41990a354497b128e154da04fec58ae9
Vendor must be a logical partition and boot must not be a logical
partition.
Test: fuzzy_fastboot --gtest_filter=*Logical*
Bug: 117220134
Change-Id: Ifc6f2f715ca92cd1fe779e8fce2d6a10a1f140b9
On retrofit devices, it is easy to accidentally overwrite
system/vendor/product by flashing system in the bootloader. The reason
is that GPT system_a is really the super partition, and the bootloader
doesn't know it.
Addressing this in bootloaders would require two separate commands: one
that rejects flashing system/vendor/product, and another for
expert/factory use that would allow direct flashing.
This patch introduces protection into the host fastboot tool instead.
It's not mutually exclusive with bootloader changes; having protection
in the host tool affords us better and consistent UI. However it does
rely on users having newer builds.
With this change, the following will not work in the bootloader:
fastboot flash system # or vendor, product, etc
The message is the same whether or not the device is a retrofit. To
continue anyway, you can do:
fastboot flash --force system
If we decide on bootloader protection as well, the --force flag can be
re-used.
Bug: 119689480
Test: fastboot flash system # disallowed in bootloader, allowed in fastbootd
fastboot flash --force system # allowed in bootloader
Change-Id: I0861e3f28a15be925886d5c30c7ebd4b20c477cf
Cleanup to utilize all the manifest values in constants.h.
If the cli command _and_ the protocol name match, use a common
source of convenient truth. This should set a pattern for future
additional commands. When the command and the protocol differ,
we want to introduce resistance as it results in confusion and
maintenance issues.
Test: compile
Change-Id: Idad413c63cbbfcb6e851856105a5d5a9ef53ef29
This is required to pass fuzzy_fastboot conformance tests.
Also, allow for zero sized partitions in fuzzy_fastboot.
Test: ./fuzzy_fastboot --gtest_filter=Conformance.Slots
Bug: 117220134
Change-Id: Ifb12994a7796b081215084cb68b37674210aaa12
Sparse images with CRC are currently not supported by the
Android build system.
Test: ./fuzzy_fastboot --gtest_filter=Conformance.*
Change-Id: I6a73fb0dc5d4c77a3d1a0384c137789eb06fa956
Replace the remnants of engine.cpp with better functionality in
FastBootDriver. Particularly, add prolog() and epilog()
callbacks to FastBootDriver for printing actions and their result to
the console. Then clean up the rest of fastboot.cpp to directly use
FastBootDriver.
Test: fastboot works
Change-Id: I0ff01d6a10f75e9dc1c82b46c6e9bb3bc4c68638
UsbTransportSniffer invokes the virtual method Close() within
its destructor. This usage is fine right now, but if a future
class inherited from UsbTransportSniffer and overrode the Close()
method, then this destructor would not act as expected.
To protect against this, we declare Close() 'final' in
UsbTransportSniffer, and add a comment.
Test: Treehugger
Change-Id: I6182d84e7caf67cb06f37c22c6203ad6d6e57f34
Partition sizes must be reported with an "0x" prefix for fuzzy_fastboot.
Also, with dynamic partitions, the size of a partition can be 0.
Bug: 78793464
Test: fuzzy_fastboot Conformance.PartitionInfo does not error on
partition sizes when using fastbootd
Change-Id: I4148440bd9ed420878940829618cbf8cee85bf6a
This change moves Transport ownership back out of FastBootDriver.
Callers of set_transport must ensure that the previous transport is
destroyed. In addition, deleting a transport now ensures that it is
closed.
Bug: 78793464
Test: fastboot, fuzzy_fastboot works
Change-Id: I8f9ed2f7d5b09fd0820b2677d087a027378f26db
This isn't sent by the fastboot client.
This isn't in our bootloader requirement document.
Neither my hikey nor sailfish respond to this.
Test: fastboot still works
Change-Id: I11ff0aed818d98f3427ed427605d99b3c76ccb06
This isn't sent by the fastboot client.
This isn't in our bootloader requirement document.
Neither my hikey nor sailfish respond to this.
The README.md literally uses this as an example for 'unknown command'
Test: fastboot still works.
Change-Id: Ia442a41de517dae078dd7e73c951aadb97646c73