5 # Copyright (C) Intel Corp, 2004
7 # Author: Yin Hu <hu.yin@intel.com>
9 # This is a script for replacing udev binary during udevsend/udevd testing.
10 # It first amplifies the execution time ( sleep 5 ) and then logs the event
11 # information sent by udved in order that test script udevd-test.pl can
12 # analyze whether udved execute as we expected.
13 # You should not execute this script directly because it will be invoked by
14 # udevd automatically.
16 # Before you run your test please modify $log_file to designate where the udev
17 # log file should be placed, in fact, the default value is ok.
20 # This program is free software; you can redistribute it and/or modify it
21 # under the terms of the GNU General Public License as published by the
22 # Free Software Foundation version 2 of the License.
24 # This program is distributed in the hope that it will be useful, but
25 # WITHOUT ANY WARRANTY; without even the implied warranty of
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 # General Public License for more details.
29 # You should have received a copy of the GNU General Public License along
30 # with this program; if not, write to the Free Software Foundation, Inc.,
31 # 675 Mass Ave, Cambridge, MA 02139, USA.
38 my $udev_exe_time = 5;
39 my $log_file = "/tmp/udev_log.txt";
42 my $subsystem = $ARGV[0];
43 my $devpath = $ENV{DEVPATH};
44 my $action = $ENV{ACTION};
48 if (open(LOGF, ">>$log_file")) {
49 print LOGF "$devpath,$action,$subsystem,$time\n";
51 print "File open failed. \n";
56 # Amplify the execution time of udev
61 print "Too less argument count.\n";