Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zfs-qemu-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ on:
default: ""
description: "(optional) repo URL (blank: use http://download.zfsonlinux.org)"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zfs-qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
description: "(optional) Experimental kernel version to install on Fedora (like '6.14' or '6.13.3-0.rc3')"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zloop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
Expand Down
1 change: 1 addition & 0 deletions lib/libshare/libshare_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/
#ifndef _LIBSPL_LIBSHARE_IMPL_H
#define _LIBSPL_LIBSHARE_IMPL_H
#include <sys/stdtypes.h> /* boolean_t */

typedef const struct sa_share_impl {
const char *sa_zfsname;
Expand Down
8 changes: 8 additions & 0 deletions lib/libshare/os/linux/nfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ const sa_fstype_t libshare_nfs_type = {
static boolean_t
nfs_available(void)
{
#ifdef TRUENAS_ENABLE_ZFS_SHARING
static int avail;

if (!avail) {
Expand All @@ -569,11 +570,15 @@ nfs_available(void)
}

return (avail == 1);
#else
return (B_FALSE);
#endif
}

static boolean_t
exports_available(void)
{
#ifdef TRUENAS_ENABLE_ZFS_SHARING
static int avail;

if (!avail) {
Expand All @@ -584,4 +589,7 @@ exports_available(void)
}

return (avail == 1);
#else
return (B_FALSE);
#endif
}
5 changes: 5 additions & 0 deletions lib/libshare/os/linux/smb.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ const sa_fstype_t libshare_smb_type = {
static boolean_t
smb_available(void)
{
#ifdef TRUENAS_ENABLE_ZFS_SHARING
static int avail;

if (!avail) {
Expand All @@ -404,4 +405,8 @@ smb_available(void)
}

return (avail == 1);
#else
/* TrueNAS: Disable SMB sharing */
return (B_FALSE);
#endif
}
24 changes: 13 additions & 11 deletions tests/runfiles/common.run
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,13 @@ tests = ['cache_001_pos', 'cache_002_neg', 'canmount_001_pos',
'zfs_set_feature_activation', 'zfs_set_nomount']
tags = ['functional', 'cli_root', 'zfs_set']

[tests/functional/cli_root/zfs_share]
tests = ['zfs_share_001_pos', 'zfs_share_002_pos', 'zfs_share_003_pos',
'zfs_share_004_pos', 'zfs_share_006_pos', 'zfs_share_008_neg',
'zfs_share_010_neg', 'zfs_share_011_pos', 'zfs_share_concurrent_shares',
'zfs_share_after_mount']
tags = ['functional', 'cli_root', 'zfs_share']
# TrueNAS: Disable share tests
# [tests/functional/cli_root/zfs_share]
# tests = ['zfs_share_001_pos', 'zfs_share_002_pos', 'zfs_share_003_pos',
# 'zfs_share_004_pos', 'zfs_share_006_pos', 'zfs_share_008_neg',
# 'zfs_share_010_neg', 'zfs_share_011_pos', 'zfs_share_concurrent_shares',
# 'zfs_share_after_mount']
# tags = ['functional', 'cli_root', 'zfs_share']

[tests/functional/cli_root/zfs_snapshot]
tests = ['zfs_snapshot_001_neg', 'zfs_snapshot_002_neg',
Expand All @@ -360,11 +361,12 @@ tests = ['zfs_unmount_001_pos', 'zfs_unmount_002_pos', 'zfs_unmount_003_pos',
'zfs_unmount_all_001_pos', 'zfs_unmount_nested', 'zfs_unmount_unload_keys']
tags = ['functional', 'cli_root', 'zfs_unmount']

[tests/functional/cli_root/zfs_unshare]
tests = ['zfs_unshare_001_pos', 'zfs_unshare_002_pos', 'zfs_unshare_003_pos',
'zfs_unshare_004_neg', 'zfs_unshare_005_neg', 'zfs_unshare_006_pos',
'zfs_unshare_007_pos']
tags = ['functional', 'cli_root', 'zfs_unshare']
# TrueNAS: Disable unshare tests
# [tests/functional/cli_root/zfs_unshare]
# tests = ['zfs_unshare_001_pos', 'zfs_unshare_002_pos', 'zfs_unshare_003_pos',
# 'zfs_unshare_004_neg', 'zfs_unshare_005_neg', 'zfs_unshare_006_pos',
# 'zfs_unshare_007_pos']
# tags = ['functional', 'cli_root', 'zfs_unshare']

[tests/functional/cli_root/zfs_upgrade]
tests = ['zfs_upgrade_001_pos', 'zfs_upgrade_002_pos', 'zfs_upgrade_003_pos',
Expand Down
18 changes: 10 additions & 8 deletions tests/runfiles/linux.run
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ tests = ['zfs_mount_006_pos', 'zfs_mount_008_pos', 'zfs_mount_013_pos',
'zfs_mount_014_neg', 'zfs_multi_mount']
tags = ['functional', 'cli_root', 'zfs_mount']

[tests/functional/cli_root/zfs_share:Linux]
tests = ['zfs_share_005_pos', 'zfs_share_007_neg', 'zfs_share_009_neg',
'zfs_share_012_pos', 'zfs_share_013_pos']
tags = ['functional', 'cli_root', 'zfs_share']

[tests/functional/cli_root/zfs_unshare:Linux]
tests = ['zfs_unshare_008_pos']
tags = ['functional', 'cli_root', 'zfs_unshare']
# TrueNAS: Disable share tests
# [tests/functional/cli_root/zfs_share:Linux]
# tests = ['zfs_share_005_pos', 'zfs_share_007_neg', 'zfs_share_009_neg',
# 'zfs_share_012_pos', 'zfs_share_013_pos']
# tags = ['functional', 'cli_root', 'zfs_share']

# TrueNAS: Disable unshare tests
# [tests/functional/cli_root/zfs_unshare:Linux]
# tests = ['zfs_unshare_008_pos']
# tags = ['functional', 'cli_root', 'zfs_unshare']

[tests/functional/cli_root/zfs_sysfs:Linux]
tests = ['zfeature_set_unsupported', 'zfs_get_unsupported',
Expand Down
4 changes: 4 additions & 0 deletions tests/test-runner/bin/zts-report.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ if sys.platform.startswith('freebsd'):
else:
cfr_cross_reason = 'copy_file_range(2) cross-filesystem needs kernel 5.3+'

# TrueNAS
truenas_skip = 'SKIP: Test not supported in TrueNAS'

#
# These tests are known to fail, thus we use this list to prevent these
# failures from failing the job as a whole; only unexpected failures
Expand All @@ -164,6 +167,7 @@ known = {
'rootpool/setup': ['SKIP', na_reason],
'rsend/rsend_008_pos': ['SKIP', 6066],
'vdev_zaps/vdev_zaps_007_pos': ['FAIL', known_reason],
'cli_root/zpool_import/zpool_import_012_pos': ['SKIP', truenas_skip],
}

if sys.platform.startswith('freebsd'):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,17 @@ while (( i < ${#dataset_pos[*]} )) ; do
dataset=${dataset_pos[i]}
set_n_check_prop "noauto" "canmount" "$dataset"
log_must zfs set mountpoint=$tmpmnt $dataset
log_must zfs set sharenfs=on $dataset
# TrueNAS: sharenfs disabled and cannot test with log_must or log_mustnot
# log_must zfs set sharenfs=on $dataset
if ismounted $dataset; then
zfs unmount -a > /dev/null 2>&1
log_must mounted $dataset
log_must zfs unmount $dataset
log_must unmounted $dataset
log_must zfs mount -a
log_must unmounted $dataset
log_must zfs share -a
log_mustnot is_exported $tmpmnt
# log_must zfs share -a # TrueNAS: Do not share via ZFS
# log_mustnot is_exported $tmpmnt # TrueNAS: avoid false failure
else
log_must zfs mount -a
log_must unmounted $dataset
Expand All @@ -140,9 +141,10 @@ while (( i < ${#dataset_pos[*]} )) ; do

log_must zfs mount $dataset
log_must mounted $dataset
log_must zfs share -a
log_must is_exported $tmpmnt
# log_must zfs share -a # TrueNAS: Do not share via ZFS
# log_must is_exported $tmpmnt # TrueNAS: avoid false failure

# TrueNAS: set of sharenfs property tested here
log_must zfs set sharenfs="${old_sharenfs[i]}" $dataset
log_must zfs set canmount="${old_canmount[i]}" $dataset
log_must zfs set mountpoint="${old_mnt[i]}" $dataset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@

verify_runnable "global"

log_unsupported "SKIP: sharenfs is disabled on TrueNAS"

set -A pools "$TESTPOOL" "$TESTPOOL1"
set -A devs "" "-d $DEVICE_DIR"
set -A options "" "-R $ALTER_ROOT"
Expand Down
Loading