~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/livepatch/test-sysfs.sh

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/testing/selftests/livepatch/test-sysfs.sh (Version linux-6.12-rc7) and /tools/testing/selftests/livepatch/test-sysfs.sh (Version linux-3.10.108)


  1 #!/bin/bash                                       
  2 # SPDX-License-Identifier: GPL-2.0                
  3 # Copyright (C) 2022 Song Liu <song@kernel.org>    
  4                                                   
  5 . $(dirname $0)/functions.sh                      
  6                                                   
  7 MOD_LIVEPATCH=test_klp_livepatch                  
  8                                                   
  9 setup_config                                      
 10                                                   
 11 # - load a livepatch and verifies the sysfs en    
 12                                                   
 13 start_test "sysfs test"                           
 14                                                   
 15 load_lp $MOD_LIVEPATCH                            
 16                                                   
 17 check_sysfs_rights "$MOD_LIVEPATCH" "" "drwxr-    
 18 check_sysfs_rights "$MOD_LIVEPATCH" "enabled"     
 19 check_sysfs_value  "$MOD_LIVEPATCH" "enabled"     
 20 check_sysfs_rights "$MOD_LIVEPATCH" "force" "-    
 21 check_sysfs_rights "$MOD_LIVEPATCH" "replace"     
 22 check_sysfs_rights "$MOD_LIVEPATCH" "transitio    
 23 check_sysfs_value  "$MOD_LIVEPATCH" "transitio    
 24 check_sysfs_rights "$MOD_LIVEPATCH" "vmlinux/p    
 25 check_sysfs_value  "$MOD_LIVEPATCH" "vmlinux/p    
 26                                                   
 27 disable_lp $MOD_LIVEPATCH                         
 28                                                   
 29 unload_lp $MOD_LIVEPATCH                          
 30                                                   
 31 check_result "% insmod test_modules/$MOD_LIVEP    
 32 livepatch: enabling patch '$MOD_LIVEPATCH'        
 33 livepatch: '$MOD_LIVEPATCH': initializing patc    
 34 livepatch: '$MOD_LIVEPATCH': starting patching    
 35 livepatch: '$MOD_LIVEPATCH': completing patchi    
 36 livepatch: '$MOD_LIVEPATCH': patching complete    
 37 % echo 0 > /sys/kernel/livepatch/$MOD_LIVEPATC    
 38 livepatch: '$MOD_LIVEPATCH': initializing unpa    
 39 livepatch: '$MOD_LIVEPATCH': starting unpatchi    
 40 livepatch: '$MOD_LIVEPATCH': completing unpatc    
 41 livepatch: '$MOD_LIVEPATCH': unpatching comple    
 42 % rmmod $MOD_LIVEPATCH"                           
 43                                                   
 44 start_test "sysfs test object/patched"            
 45                                                   
 46 MOD_LIVEPATCH=test_klp_callbacks_demo             
 47 MOD_TARGET=test_klp_callbacks_mod                 
 48 load_lp $MOD_LIVEPATCH                            
 49                                                   
 50 # check the "patch" file changes as target mod    
 51 check_sysfs_value  "$MOD_LIVEPATCH" "$MOD_TARG    
 52 load_mod $MOD_TARGET                              
 53 check_sysfs_value  "$MOD_LIVEPATCH" "$MOD_TARG    
 54 unload_mod $MOD_TARGET                            
 55 check_sysfs_value  "$MOD_LIVEPATCH" "$MOD_TARG    
 56                                                   
 57 disable_lp $MOD_LIVEPATCH                         
 58 unload_lp $MOD_LIVEPATCH                          
 59                                                   
 60 check_result "% insmod test_modules/test_klp_c    
 61 livepatch: enabling patch 'test_klp_callbacks_    
 62 livepatch: 'test_klp_callbacks_demo': initiali    
 63 test_klp_callbacks_demo: pre_patch_callback: v    
 64 livepatch: 'test_klp_callbacks_demo': starting    
 65 livepatch: 'test_klp_callbacks_demo': completi    
 66 test_klp_callbacks_demo: post_patch_callback:     
 67 livepatch: 'test_klp_callbacks_demo': patching    
 68 % insmod test_modules/test_klp_callbacks_mod.k    
 69 livepatch: applying patch 'test_klp_callbacks_    
 70 test_klp_callbacks_demo: pre_patch_callback: t    
 71 test_klp_callbacks_demo: post_patch_callback:     
 72 test_klp_callbacks_mod: test_klp_callbacks_mod    
 73 % rmmod test_klp_callbacks_mod                    
 74 test_klp_callbacks_mod: test_klp_callbacks_mod    
 75 test_klp_callbacks_demo: pre_unpatch_callback:    
 76 livepatch: reverting patch 'test_klp_callbacks    
 77 test_klp_callbacks_demo: post_unpatch_callback    
 78 % echo 0 > /sys/kernel/livepatch/test_klp_call    
 79 livepatch: 'test_klp_callbacks_demo': initiali    
 80 test_klp_callbacks_demo: pre_unpatch_callback:    
 81 livepatch: 'test_klp_callbacks_demo': starting    
 82 livepatch: 'test_klp_callbacks_demo': completi    
 83 test_klp_callbacks_demo: post_unpatch_callback    
 84 livepatch: 'test_klp_callbacks_demo': unpatchi    
 85 % rmmod test_klp_callbacks_demo"                  
 86                                                   
 87 start_test "sysfs test replace enabled"           
 88                                                   
 89 MOD_LIVEPATCH=test_klp_atomic_replace             
 90 load_lp $MOD_LIVEPATCH replace=1                  
 91                                                   
 92 check_sysfs_rights "$MOD_LIVEPATCH" "replace"     
 93 check_sysfs_value  "$MOD_LIVEPATCH" "replace"     
 94                                                   
 95 disable_lp $MOD_LIVEPATCH                         
 96 unload_lp $MOD_LIVEPATCH                          
 97                                                   
 98 check_result "% insmod test_modules/$MOD_LIVEP    
 99 livepatch: enabling patch '$MOD_LIVEPATCH'        
100 livepatch: '$MOD_LIVEPATCH': initializing patc    
101 livepatch: '$MOD_LIVEPATCH': starting patching    
102 livepatch: '$MOD_LIVEPATCH': completing patchi    
103 livepatch: '$MOD_LIVEPATCH': patching complete    
104 % echo 0 > /sys/kernel/livepatch/$MOD_LIVEPATC    
105 livepatch: '$MOD_LIVEPATCH': initializing unpa    
106 livepatch: '$MOD_LIVEPATCH': starting unpatchi    
107 livepatch: '$MOD_LIVEPATCH': completing unpatc    
108 livepatch: '$MOD_LIVEPATCH': unpatching comple    
109 % rmmod $MOD_LIVEPATCH"                           
110                                                   
111 start_test "sysfs test replace disabled"          
112                                                   
113 load_lp $MOD_LIVEPATCH replace=0                  
114                                                   
115 check_sysfs_rights "$MOD_LIVEPATCH" "replace"     
116 check_sysfs_value  "$MOD_LIVEPATCH" "replace"     
117                                                   
118 disable_lp $MOD_LIVEPATCH                         
119 unload_lp $MOD_LIVEPATCH                          
120                                                   
121 check_result "% insmod test_modules/$MOD_LIVEP    
122 livepatch: enabling patch '$MOD_LIVEPATCH'        
123 livepatch: '$MOD_LIVEPATCH': initializing patc    
124 livepatch: '$MOD_LIVEPATCH': starting patching    
125 livepatch: '$MOD_LIVEPATCH': completing patchi    
126 livepatch: '$MOD_LIVEPATCH': patching complete    
127 % echo 0 > /sys/kernel/livepatch/$MOD_LIVEPATC    
128 livepatch: '$MOD_LIVEPATCH': initializing unpa    
129 livepatch: '$MOD_LIVEPATCH': starting unpatchi    
130 livepatch: '$MOD_LIVEPATCH': completing unpatc    
131 livepatch: '$MOD_LIVEPATCH': unpatching comple    
132 % rmmod $MOD_LIVEPATCH"                           
133                                                   
134 exit 0                                            
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php