This repository was archived by the owner on Mar 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed
Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 11[package ]
2- name = " chrdev-tests"
2+ name = " chrdev-region-allocation- tests"
33version = " 0.1.0"
44authors = [" Alex Gaynor <alex.gaynor@gmail.com>" , " Geoffrey Thomas <geofft@ldpreload.com>" ]
55edition = " 2018"
Original file line number Diff line number Diff line change 33
44use linux_kernel_module;
55
6- struct ChrdevTestModule {
6+ struct ChrdevRegionAllocationTestModule {
77 _dev : linux_kernel_module:: chrdev:: DeviceNumberRegion ,
88}
99
10- impl linux_kernel_module:: KernelModule for ChrdevTestModule {
10+ impl linux_kernel_module:: KernelModule for ChrdevRegionAllocationTestModule {
1111 fn init ( ) -> linux_kernel_module:: KernelResult < Self > {
12- Ok ( ChrdevTestModule {
12+ Ok ( ChrdevRegionAllocationTestModule {
1313 _dev : linux_kernel_module:: chrdev:: DeviceNumberRegion :: allocate (
1414 0 ..1 ,
15- "chrdev-tests\x00 " ,
15+ "chrdev-region-allocation- tests\x00 " ,
1616 ) ?,
1717 } )
1818 }
1919}
2020
2121linux_kernel_module:: kernel_module!(
22- ChrdevTestModule ,
22+ ChrdevRegionAllocationTestModule ,
2323 author: "Alex Gaynor and Geoffrey Thomas" ,
24- description: "A module for testing character devices " ,
24+ description: "A module for testing character device region allocation " ,
2525 license: "GPL"
2626) ;
Original file line number Diff line number Diff line change @@ -7,19 +7,19 @@ fn test_proc_devices() {
77 let devices = fs:: read_to_string ( "/proc/devices" ) . unwrap ( ) ;
88 let dev_no_line = devices
99 . lines ( )
10- . find ( |l| l. ends_with ( "chrdev-tests" ) )
10+ . find ( |l| l. ends_with ( "chrdev-region-allocation- tests" ) )
1111 . unwrap ( ) ;
1212 let elements = dev_no_line. rsplitn ( 2 , " " ) . collect :: < Vec < _ > > ( ) ;
1313 assert_eq ! ( elements. len( ) , 2 ) ;
14- assert_eq ! ( elements[ 0 ] , "chrdev-tests" ) ;
14+ assert_eq ! ( elements[ 0 ] , "chrdev-region-allocation- tests" ) ;
1515 assert ! ( elements[ 1 ] . trim( ) . parse:: <u32 >( ) . is_ok( ) ) ;
1616 } ) ;
1717
1818 let devices = fs:: read_to_string ( "/proc/devices" ) . unwrap ( ) ;
1919 assert ! (
2020 devices
2121 . lines( )
22- . find( |l| l. ends_with( "chrdev-tests" ) )
22+ . find( |l| l. ends_with( "chrdev-region-allocation- tests" ) )
2323 . is_none( )
2424 ) ;
2525}
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def main():
4343 module = os .path .join (
4444 BASE_DIR ,
4545 "target/x86_64-linux-kernel-module/debug/lib{}_tests.a" .format (
46- path
46+ path . replace ( "-" , "_" )
4747 )
4848 )
4949 run (
You can’t perform that action at this time.
0 commit comments