VirtualBox

Ignore:
Timestamp:
May 17, 2011 11:14:50 AM (14 years ago)
Author:
vboxsync
Message:

Installer/linux: correct udev RUN rule and only install rules for USB with recent udev

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/testcase/tstInstallerLinux.sh

    r37120 r37123  
    2222echo "Testing udev rule generation for the \".run\" installer"
    2323
     24setup_test_input_install_udev ".run, udev-59" 59
     25
     26udev_59_rules=`cat <<'UDEV_END'
     27KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"
     28SUBSYSTEM=="usb_device", ACTION=="add", RUN+="/opt/VirtualBox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
     29SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN+="/opt/VirtualBox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
     30SUBSYSTEM=="usb_device", ACTION=="remove", RUN+="/opt/VirtualBox/VBoxCreateUSBNode.sh --remove $major $minor"
     31SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN+="/opt/VirtualBox/VBoxCreateUSBNode.sh --remove $major $minor"
     32UDEV_END`
     33
     34install_udev_output="`install_udev_run vboxusers 0660 /opt/VirtualBox`"
     35case "$install_udev_output" in
     36    "$udev_59_rules") ;;
     37    *)
     38        echo "Bad output for udev version 59.  Expected:"
     39        echo "$udev_59_rules"
     40        echo "Actual:"
     41        echo "$install_udev_output"
     42        CERRS="`expr "$CERRS" + 1`"
     43        ;;
     44esac
     45
     46cleanup_test_input_install_udev
     47
    2448setup_test_input_install_udev ".run, udev-55" 55
    2549
    2650udev_55_rules=`cat <<'UDEV_END'
    2751KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"
    28 SUBSYSTEM=="usb_device", ACTION=="add", RUN="/opt/VirtualBox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
    29 SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN="/opt/VirtualBox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
    30 SUBSYSTEM=="usb_device", ACTION=="remove", RUN="/opt/VirtualBox/VBoxCreateUSBNode.sh --remove $major $minor"
    31 SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN="/opt/VirtualBox/VBoxCreateUSBNode.sh --remove $major $minor"
    3252UDEV_END`
    3353
     
    5070udev_54_rules=`cat <<'UDEV_END'
    5171KERNEL="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0600"
    52 SUBSYSTEM="usb_device", ACTION="add", RUN="/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
    53 SUBSYSTEM="usb", ACTION="add", ENV{DEVTYPE}="usb_device", RUN="/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
    54 SUBSYSTEM="usb_device", ACTION="remove", RUN="/usr/lib/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"
    55 SUBSYSTEM="usb", ACTION="remove", ENV{DEVTYPE}="usb_device", RUN="/usr/lib/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"
    5672UDEV_END`
    5773
     
    6884esac
    6985
     86cleanup_test_input_install_udev
     87
    7088echo "Testing udev rule generation for the \"package\" installer"
     89
     90setup_test_input_install_udev "package, udev-59" 59
     91
     92udev_59_rules=`cat <<'UDEV_END'
     93KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0600"
     94SUBSYSTEM=="usb_device", ACTION=="add", RUN+="/usr/share/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass} vboxusers"
     95SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN+="/usr/share/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass} vboxusers"
     96SUBSYSTEM=="usb_device", ACTION=="remove", RUN+="/usr/share/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"
     97SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN+="/usr/share/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"
     98UDEV_END`
     99
     100install_udev_output="`install_udev_package vboxusers`"
     101case "$install_udev_output" in
     102    "$udev_59_rules") ;;
     103    *)
     104        echo "Bad output for udev version 59.  Expected:"
     105        echo "$udev_59_rules"
     106        echo "Actual:"
     107        echo "$install_udev_output"
     108        CERRS="`expr "$CERRS" + 1`"
     109        ;;
     110esac
    71111
    72112cleanup_test_input_install_udev
     
    76116udev_55_rules=`cat <<'UDEV_END'
    77117KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0600"
    78 SUBSYSTEM=="usb_device", ACTION=="add", RUN="/usr/share/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass} vboxusers"
    79 SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN="/usr/share/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass} vboxusers"
    80 SUBSYSTEM=="usb_device", ACTION=="remove", RUN="/usr/share/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"
    81 SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN="/usr/share/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"
    82118UDEV_END`
    83119
     
    100136udev_54_rules=`cat <<'UDEV_END'
    101137KERNEL="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0600"
    102 SUBSYSTEM="usb_device", ACTION="add", RUN="/usr/share/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass} root"
    103 SUBSYSTEM="usb", ACTION="add", ENV{DEVTYPE}="usb_device", RUN="/usr/share/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass} root"
    104 SUBSYSTEM="usb_device", ACTION="remove", RUN="/usr/share/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"
    105 SUBSYSTEM="usb", ACTION="remove", ENV{DEVTYPE}="usb_device", RUN="/usr/share/virtualbox/VBoxCreateUSBNode.sh --remove $major $minor"
    106138UDEV_END`
    107139
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette