summaryrefslogtreecommitdiffstats
path: root/qa/rbd/krbd_default_map_options.t
blob: 5dac5d6aec5bc89f78122b373e5a13326b19b7c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Set up

  $ ceph osd pool create rbda
  pool 'rbda' created
  $ rbd pool init rbda
  $ rbd create rbda/image1 --size 1000

Test at map options level

  $ OPTIONS="alloc_size=65536,lock_on_read"
  $ EXPECTED="${OPTIONS}"
  $ DEV=$(sudo rbd map rbda/image1 --options ${OPTIONS})
  $ sudo grep -q ${EXPECTED} /sys/bus/rbd/devices/${DEV#/dev/rbd}/config_info
  $ sudo rbd unmap rbda/image1

Test at global level

  $ OPTIONS="alloc_size=4096,crc"
  $ EXPECTED="${OPTIONS}"
  $ rbd config global set global rbd_default_map_options ${OPTIONS}
  $ DEV=$(sudo rbd map rbda/image1)
  $ sudo grep -q ${EXPECTED} /sys/bus/rbd/devices/${DEV#/dev/rbd}/config_info
  $ sudo rbd unmap rbda/image1

  $ OPTIONS="alloc_size=65536,lock_on_read"
  $ EXPECTED="alloc_size=65536,crc,lock_on_read"
  $ DEV=$(sudo rbd map rbda/image1 --options ${OPTIONS})
  $ sudo grep -q ${EXPECTED} /sys/bus/rbd/devices/${DEV#/dev/rbd}/config_info
  $ sudo rbd unmap rbda/image1

Test at pool level

  $ OPTIONS="alloc_size=8192,share"
  $ EXPECTED="${OPTIONS}"
  $ rbd config pool set rbda rbd_default_map_options ${OPTIONS}
  $ DEV=$(sudo rbd map rbda/image1)
  $ sudo grep -q ${EXPECTED} /sys/bus/rbd/devices/${DEV#/dev/rbd}/config_info
  $ sudo rbd unmap rbda/image1

  $ OPTIONS="lock_on_read,alloc_size=65536"
  $ EXPECTED="alloc_size=65536,lock_on_read,share"
  $ DEV=$(sudo rbd map rbda/image1 --options ${OPTIONS})
  $ sudo grep -q ${EXPECTED} /sys/bus/rbd/devices/${DEV#/dev/rbd}/config_info
  $ sudo rbd unmap rbda/image1

Test at image level

  $ OPTIONS="alloc_size=16384,tcp_nodelay"
  $ EXPECTED="${OPTIONS}"
  $ rbd config image set rbda/image1 rbd_default_map_options ${OPTIONS}
  $ DEV=$(sudo rbd map rbda/image1)
  $ sudo grep -q ${EXPECTED} /sys/bus/rbd/devices/${DEV#/dev/rbd}/config_info
  $ sudo rbd unmap rbda/image1

  $ OPTIONS="lock_on_read,alloc_size=65536"
  $ EXPECTED="alloc_size=65536,lock_on_read,tcp_nodelay"
  $ DEV=$(sudo rbd map rbda/image1 --options ${OPTIONS})
  $ sudo grep -q ${EXPECTED} /sys/bus/rbd/devices/${DEV#/dev/rbd}/config_info
  $ sudo rbd unmap rbda/image1

Teardown

  $ ceph osd pool rm rbda rbda --yes-i-really-really-mean-it
  pool 'rbda' removed