Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix udevadm.py to parser VRAID partition correctly (Bugfix) #952

Merged
merged 4 commits into from
Apr 11, 2024

Conversation

seankingyang
Copy link
Contributor

Description

The DUT with VRAID, the udevadm.py could not parser the right thing.
Push this PR could fix this bug.

Resolved issues

#482 udev_resource.py -f PARTITION failed with error

Documentation

Tests

@seankingyang seankingyang marked this pull request as draft January 19, 2024 05:38
Copy link

codecov bot commented Jan 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.74%. Comparing base (604d369) to head (d7b5fab).
Report is 25 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #952      +/-   ##
==========================================
+ Coverage   41.64%   41.74%   +0.09%     
==========================================
  Files         340      340              
  Lines       37748    37769      +21     
  Branches     6419     6422       +3     
==========================================
+ Hits        15722    15768      +46     
+ Misses      21378    21352      -26     
- Partials      648      649       +1     
Flag Coverage Δ
checkbox-support 51.90% <100.00%> (+0.72%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stanley31huang
Copy link
Collaborator

stanley31huang commented Mar 21, 2024

I have verified this fixed on an IoT platform, which has Intel RST RAID enabled. And we could get the disk info by udev_resource.py scripts without errors.

path: /devices/virtual/block/md0
name: md0
bus: block
category: DISK

path: /devices/virtual/block/md126
name: md126
bus: block
category: DISK
product: Volume1_0
vendor: raid0
product_slug: Volume1_0
vendor_slug: raid0

path: /devices/virtual/block/md126/md126p1
name: md126p1
bus: block
product: Volume1_0
vendor: raid0
product_slug: Volume1_0
vendor_slug: raid0

path: /devices/virtual/block/md126/md126p2
name: md126p2
bus: block
product: Volume1_0
vendor: raid0
product_slug: Volume1_0
vendor_slug: raid0

path: /devices/virtual/block/md127
name: md127
bus: block
category: DISK
vendor: container
vendor_slug: container

Test results:

ubuntu@ubuntu:~/checkbox-support$ sudo checkbox-iiotg-classic.shell 
checkbox-iiotg-classic runtime shell, type 'exit' to quit the session

# disk/storage_device_{name} test
root@ubuntu:/home/ubuntu/checkbox-support# python3 /snap/checkbox22/current/providers/checkbox-provider-base/bin/storage_test.py md126
Testing disk md126
identified as a disk...
test will be run on partition /dev/md126p2
/dev/md126p2 already mounted at /
456254.55078125MB of free space avaialble
Forcing memory setting to 8000MB
+ bonnie++ -d / -u root -r 8000
Using uid:0, gid:0.
Writing a byte at a time...done
Writing intelligently...done
Rewriting...done
Reading a byte at a time...done
Reading intelligently...done
start 'em...done...done...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
Version  2.00       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Name:Size etc        /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
ubuntu          16G 1318k  99  416m  33  407m  26 4443k  96  7.2g  99 +++++ +++
Latency              6199us   81539us   43831us    1868us      25us      53us
Version  2.00       ------Sequential Create------ --------Random Create--------
ubuntu              -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++
Latency               545us     224us    2632us      39us      20us    2542us
1.98,2.00,ubuntu,1,1710984956,16G,,8192,5,1318,99,425571,33,417002,26,4443,96,7589910,99,+++++,+++,16,,,,,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,6199us,81539us,43831us,1868us,25us,53us,545us,224us,2632us,39us,20us,2542us

# disk/read_performance_{name} test
root@ubuntu:/home/ubuntu# bash /snap/checkbox22/current/providers/checkbox-provider-base/bin/disk_read_performance_test.sh md127
Beginning /snap/checkbox22/current/providers/checkbox-provider-base/bin/disk_read_performance_test.sh test for md127
---------------------------------------------------
INFO: md127 type is mdadm
INFO: mdadm: Using 80 MB/sec as the minimum throughput speed

Beginning hdparm timing runs
---------------------------------------------------
INFO: Iteration 1: Detected speed is  MB/sec
WARNING: Device md127 is too small! Aborting test.

# disk/stats_{name} test
root@ubuntu:/home/ubuntu# bash /snap/checkbox22/current/providers/checkbox-provider-base/bin/disk_stats_test.sh md126
PASS: Finished testing stats for md126

@seankingyang seankingyang marked this pull request as ready for review March 22, 2024 02:12
@seankingyang seankingyang force-pushed the Fix_udev_for_VARID branch 4 times, most recently from e170579 to 11c801e Compare March 22, 2024 05:12
@seankingyang seankingyang requested a review from pieqq March 22, 2024 05:21
Copy link
Contributor

@kissiel kissiel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could checkbox-support/checkbox_support/parsers/tests/udevadm_data/With_VRAID.txt be reduced to contain only the parts that are interesting?
16kLOC takes quite a while to parse, it's also a burden for the repo. I know we've committed files like that in the past, but we definitely need to stop.

@zongminl zongminl marked this pull request as draft March 29, 2024 03:33
@seankingyang
Copy link
Contributor Author

Minimize the input data(With_VRAID.txt), and modify the test_udevadm.py to remove the unnecessary code which added former commit.

@seankingyang seankingyang requested a review from kissiel April 3, 2024 09:21
@seankingyang seankingyang marked this pull request as ready for review April 3, 2024 09:21
Copy link
Contributor

@kissiel kissiel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for making the test run in a reasonable time!
+1

@kissiel kissiel merged commit de07b8b into canonical:main Apr 11, 2024
13 checks passed
LiaoU3 pushed a commit to LiaoU3/checkbox that referenced this pull request Apr 17, 2024
…l#952)

* Fix for VRAID

* Add the unit test data

* Reduce the input data size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants