summaryrefslogtreecommitdiff
path: root/tests/fs/bcachefs/nfs.ktest
blob: 411debd8bb70da3f5c23c4dca5d66be8d1423c36 (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
#!/usr/bin/env bash

. $(dirname $(readlink -e ${BASH_SOURCE[0]}))/bcachefs-test-libs.sh

config-scratch-devs 4G

config-timeout $(stress_timeout)
# test nfs exports:
require-kernel-config NFSD
require-kernel-config NFSD_V4

require-kernel-config NFS_FS
require-kernel-config NFS_V4

test_nfs()
{
    mkdir /export1 /export2

    run_quiet "" bcachefs format -f		\
	--errors=panic				\
	${ktest_scratch_dev[0]}
    mount -t bcachefs ${ktest_scratch_dev[0]} /export2

    echo "/export1  *(rw,insecure,no_root_squash,no_subtree_check)" >> /etc/exports
    echo "/export2  *(rw,insecure,no_root_squash,no_subtree_check)" >> /etc/exports
    exportfs -a

    mount -t nfs localhost:/export2 /mnt
    dbench -S -t 30 2 -D /mnt/
    umount /mnt

    exportfs -ua
    umount /export2
}

main "$@"