Skip to content

Instantly share code, notes, and snippets.

@ancorgs
Last active November 2, 2020 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ancorgs/fbfa81ea3ab82050e043cb8e505ccabe to your computer and use it in GitHub Desktop.
Save ancorgs/fbfa81ea3ab82050e043cb8e505ccabe to your computer and use it in GitHub Desktop.
Test cases for the _netdev option

RSpec output for Y2Storage::Disk (excerpt)

#in_network?

  • for a disk with data transport fcoe
    • returns true
  • for a disk with data transport iscsi
    • returns true
  • for a disk with data transport fc (same applies to sbp, sas, sata, spi & usb)
    • returns false
  • for a disk with unknown data transport
    • returns false

RSpec output for Y2Storage::MountPoint (excerpt)

#set_default_mount_options

  • in an NFS filesystem
    • sets #mount_options to an empty array
  • in a local disk (i.e. BlkDevice#in network? returns false)
    • for a Btrfs file-system (the same applies to most file-system types)
      • sets #mount_options to an empty array
    • for an Ext3 file-system (the same applies to Ext4)
      • sets #mount_options to an array containing only the data=ordered option
    • for a Btrfs subvolume
      • sets #mount_options to an array containing only the subvol option
  • in a remote disk (i.e. BlkDevice#in network? returns true)
    • for the root filesystem
      • for a Btrfs file-system (the same applies to most file-system types)
        • sets #mount_options to an empty array
      • for an Ext3 file-system (the same applies to Ext4)
        • sets #mount_options to an empty array
      • for a Btrfs subvolume
        • sets #mount_options to an array containing only the subvol option
    • for a non-root filesystem
      • for a Btrfs file-system (the same applies to most file-system types)
        • sets #mount_options to an array containing only '_netdev'
      • for an Ext3 file-system (the same applies to Ext4)
        • sets #mount_options to an array containing the 'data=ordered' and '_netdev' options
      • for a Btrfs subvolume
        • sets #mount_options to an array containing only the subvol option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment