����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 216.73.216.211 Web Server : Apache/2.4.41 (Ubuntu) System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/modules/5.4.0-163-generic/build/tools/testing/selftests/efivarfs/ |
Upload File : |
#!/bin/bash # SPDX-License-Identifier: GPL-2.0 efivarfs_mount=/sys/firmware/efi/efivars test_guid=210be57c-9849-4fc7-a635-e6382d1aec27 # Kselftest framework requirement - SKIP code is 4. ksft_skip=4 file_cleanup() { chattr -i $1 rm -f $1 } check_prereqs() { local msg="skip all tests:" if [ $UID != 0 ]; then echo $msg must be run as root >&2 exit $ksft_skip fi if ! grep -q "^\S\+ $efivarfs_mount efivarfs" /proc/mounts; then echo $msg efivarfs is not mounted on $efivarfs_mount >&2 exit $ksft_skip fi } run_test() { local test="$1" echo "--------------------" echo "running $test" echo "--------------------" if [ "$(type -t $test)" = 'function' ]; then ( $test ) else ( ./$test ) fi if [ $? -ne 0 ]; then echo " [FAIL]" rc=1 else echo " [PASS]" fi } test_create() { local attrs='\x07\x00\x00\x00' local file=$efivarfs_mount/$FUNCNAME-$test_guid printf "$attrs\x00" > $file if [ ! -e $file ]; then echo "$file couldn't be created" >&2 exit 1 fi if [ $(stat -c %s $file) -ne 5 ]; then echo "$file has invalid size" >&2 file_cleanup $file exit 1 fi file_cleanup $file } test_create_empty() { local file=$efivarfs_mount/$FUNCNAME-$test_guid : > $file if [ ! -e $file ]; then echo "$file can not be created without writing" >&2 exit 1 fi file_cleanup $file } test_create_read() { local file=$efivarfs_mount/$FUNCNAME-$test_guid ./create-read $file if [ $? -ne 0 ]; then echo "create and read $file failed" file_cleanup $file exit 1 fi file_cleanup $file } test_delete() { local attrs='\x07\x00\x00\x00' local file=$efivarfs_mount/$FUNCNAME-$test_guid printf "$attrs\x00" > $file if [ ! -e $file ]; then echo "$file couldn't be created" >&2 exit 1 fi file_cleanup $file if [ -e $file ]; then echo "$file couldn't be deleted" >&2 exit 1 fi } # test that we can remove a variable by issuing a write with only # attributes specified test_zero_size_delete() { local attrs='\x07\x00\x00\x00' local file=$efivarfs_mount/$FUNCNAME-$test_guid printf "$attrs\x00" > $file if [ ! -e $file ]; then echo "$file does not exist" >&2 exit 1 fi chattr -i $file printf "$attrs" > $file if [ -e $file ]; then echo "$file should have been deleted" >&2 exit 1 fi } test_open_unlink() { local file=$efivarfs_mount/$FUNCNAME-$test_guid ./open-unlink $file } # test that we can create a range of filenames test_valid_filenames() { local attrs='\x07\x00\x00\x00' local ret=0 local file_list="abc dump-type0-11-1-1362436005 1234 -" for f in $file_list; do local file=$efivarfs_mount/$f-$test_guid printf "$attrs\x00" > $file if [ ! -e $file ]; then echo "$file could not be created" >&2 ret=1 else file_cleanup $file fi done exit $ret } test_invalid_filenames() { local attrs='\x07\x00\x00\x00' local ret=0 local file_list=" -1234-1234-1234-123456789abc foo foo-bar -foo- foo-barbazba-foob-foob-foob-foobarbazfoo foo------------------------------------- -12345678-1234-1234-1234-123456789abc a-12345678=1234-1234-1234-123456789abc a-12345678-1234=1234-1234-123456789abc a-12345678-1234-1234=1234-123456789abc a-12345678-1234-1234-1234=123456789abc 1112345678-1234-1234-1234-123456789abc" for f in $file_list; do local file=$efivarfs_mount/$f printf "$attrs\x00" 2>/dev/null > $file if [ -e $file ]; then echo "Creating $file should have failed" >&2 file_cleanup $file ret=1 fi done exit $ret } check_prereqs rc=0 run_test test_create run_test test_create_empty run_test test_create_read run_test test_delete run_test test_zero_size_delete run_test test_open_unlink run_test test_valid_filenames run_test test_invalid_filenames exit $rc