FreeNAS/freenas 3d882c4 — src/middlewared/middlewared/pytest/unit/plugins test_container_attachment_matching.py test_vm_attachment_matching.py, tests/api2 test_pool_reimport.py

Replace mock tests with integration tests
DeltaFile
+68-11tests/api2/test_pool_reimport.py
+0-57src/middlewared/middlewared/pytest/unit/plugins/test_vm_attachment_matching.py
+4-25src/middlewared/middlewared/pytest/unit/plugins/test_container_attachment_matching.py
+72-933 files

FreeNAS/freenas 5c281d3 — src/middlewared/middlewared/common/attachment __init__.py, src/middlewared/middlewared/plugins/container attachments.py

`start_on_import` -> `start_on_reimport`
DeltaFile
+1-1src/middlewared/middlewared/plugins/vm/attachments.py
+1-1src/middlewared/middlewared/plugins/pool_/import_pool.py
+1-1src/middlewared/middlewared/plugins/container/attachments.py
+1-1src/middlewared/middlewared/common/attachment/__init__.py
+4-44 files

FreeNAS/freenas 4d6ee8b — src/middlewared/middlewared/common/attachment __init__.py, tests/api2 test_pool_reimport.py

Start only enabled, unlocked attachments on pool.reimport

The default FSAttachmentDelegate.start_on_import queried items with
enabled=False. On pool.reimport, a disabled share on the pool made
the share delegate start its service and reload it. A pool with only
enabled shares did not start or reload the service at all.

The default now queries enabled, unlocked items, the same as
start_on_unlock. A disabled service stays stopped, because
start_service checks the service enable flag.
DeltaFile
+65-0tests/api2/test_pool_reimport.py
+1-1src/middlewared/middlewared/common/attachment/__init__.py
+66-12 files

FreeNAS/freenas 84fae72 — src/middlewared/middlewared/plugins/container attachments.py, src/middlewared/middlewared/test/integration/utils __init__.py middleware_log.py

Auto-start containers on pool import
DeltaFile
+55-10tests/api2/test_container_pool_export.py
+23-0src/middlewared/middlewared/test/integration/utils/middleware_log.py
+21-0src/middlewared/middlewared/plugins/container/attachments.py
+2-2tests/api2/test_container_mountpoint_repair.py
+1-0src/middlewared/middlewared/test/integration/utils/__init__.py
+102-125 files

FreeNAS/freenas 84f8f11 — src/middlewared/middlewared main.py, src/middlewared/middlewared/etc_files/local/truenas-discovery/services.d TRUENAS_API.conf.py

Fix `test_truenas_api_service_on_https_port`
DeltaFile
+6-1src/middlewared/middlewared/main.py
+2-1src/middlewared/middlewared/etc_files/local/truenas-discovery/services.d/TRUENAS_API.conf.py
+8-22 files

FreeNAS/freenas e61496d — src/middlewared/middlewared/plugins/rdma rdma.py

Make RDMA link choices cache clearable

Replace the permanent @cache on rdma._get_link_choices and
rdma.get_card_choices with entries in the cache service, and add
private rdma.reset_link_choices to clear them.
DeltaFile
+46-4src/middlewared/middlewared/plugins/rdma/rdma.py
+46-41 files

FreeNAS/freenas 0c434ea — src/middlewared/middlewared/api/v27_1_0 truesearch.py, src/middlewared/middlewared/api/v28_0_0 truesearch.py

Add the truesearch.status event

The event sends what truesearch.status returns: on subscribe, on each
change in the indexer's status, and every 5 seconds while a pass runs.
Middleware holds one indexer subscription for all subscribers, so the
event takes no argument. While the indexer is down or refuses, it polls
every 5 seconds.

Each dataset's status gains progress and last_pass.
DeltaFile
+145-20src/middlewared/middlewared/plugins/truesearch.py
+45-1src/middlewared/middlewared/api/v28_0_0/truesearch.py
+45-1src/middlewared/middlewared/api/v27_1_0/truesearch.py
+43-1tests/api2/test_truesearch.py
+15-0tests/api2/test_truesearch_roles.py
+2-1tests/unit/test_truesearch.py
+295-246 files

FreeNAS/freenas 059aac1 — src/middlewared/middlewared/plugins/pool_ pool.py utils.py, src/middlewared/middlewared/plugins/zfs_ zfs_events.py

Send pool.scan events through truenas_pylibzfs instead of py-libzfs
DeltaFile
+22-0src/middlewared/middlewared/plugins/pool_/utils.py
+2-15src/middlewared/middlewared/plugins/pool_/pool.py
+16-1src/middlewared/middlewared/plugins/zpool/query_impl.py
+10-6src/middlewared/middlewared/plugins/zfs_/zfs_events.py
+6-1src/middlewared/middlewared/plugins/zpool/crud.py
+56-235 files

FreeNAS/freenas 8ef9b59 — tests/api2 test_s3_config.py, tests/sharing_protocols/s3 test_s3_head_object.py test_s3_grants.py

NAS-145406 / 27.1.0 / Require NTS for S3 Object Lock only when require_nts is set (by anodos325) (#20296)

s3d refused every time source without NTS, so on the default NTP servers
every object-locked bucket was read-only. Render require_nts into its
[server] section, and when the setting changes, restart S3 once chronyd
has selected a source again (up to 60 s).

Needs truenas_s3 with the [server] require_nts key.

Original PR: https://github.com/truenas/middleware/pull/20282

Co-authored-by: Andrew Walker <andrew.walker at truenas.com>
DeltaFile
+80-163tests/sharing_protocols/s3/test_s3_buckets.py
+42-152tests/sharing_protocols/s3/conftest.py
+31-133tests/sharing_protocols/s3/test_s3_bucket_lifecycle.py
+43-86tests/sharing_protocols/s3/test_s3_grants.py
+8-42tests/sharing_protocols/s3/test_s3_head_object.py
+34-0tests/api2/test_s3_config.py
+238-5765 files not shown
+289-57811 files

FreeNAS/freenas cde1e19 — tests/api2 test_s3_config.py, tests/sharing_protocols/s3 test_s3_head_object.py test_s3_grants.py

NAS-145406 / 28.0.0-BETA.1 / Require NTS for S3 Object Lock only when require_nts is set (#20282)

s3d refused every time source without NTS, so on the default NTP servers
every object-locked bucket was read-only. Render require_nts into its
[server] section, and when the setting changes, restart S3 once chronyd
has selected a source again (up to 60 s).

Needs truenas_s3 with the [server] require_nts key.

27.1 backport notes:
- system.security.update: the S3 hook goes in plugins/security/update.py
through middleware.call; 27 has no plugins/security/config.py
- buckets.conf.mako, lifecycle.py: system.security.config and
service.query return dicts on 27, so read require_nts and state by key
- s3 conftest: keep 27's zfs.resource.destroy for the excluded bucket's
dataset in place of master's destroy_impl
- test_s3_buckets.py needs truenas_s3 NAS-145392 (404 for a bucket no
row holds), which is on its stable/27


    [3 lines not shown]
DeltaFile
+80-163tests/sharing_protocols/s3/test_s3_buckets.py
+42-152tests/sharing_protocols/s3/conftest.py
+31-133tests/sharing_protocols/s3/test_s3_bucket_lifecycle.py
+43-86tests/sharing_protocols/s3/test_s3_grants.py
+8-42tests/sharing_protocols/s3/test_s3_head_object.py
+34-0tests/api2/test_s3_config.py
+238-5765 files not shown
+289-57811 files

FreeNAS/freenas cf7cd27 — src/middlewared/middlewared/plugins/zpool query_impl.py, src/middlewared/middlewared/pytest/unit/plugins test_zpool_query_eta.py

Match zpool status when estimating scan and expansion time remaining
DeltaFile
+95-0src/middlewared/middlewared/pytest/unit/plugins/test_zpool_query_eta.py
+15-5src/middlewared/middlewared/plugins/zpool/query_impl.py
+110-52 files

FreeNAS/freenas 7a7903c — tests/api2 test_audit_websocket.py

NAS-145425 / 27.1.0 / Fix `test_audit_websocket.test_api_key_login_failed` (#20308)

In 27.1 `login_with_api_key` doesn't go through PAM, so the error
message is different.
DeltaFile
+1-5tests/api2/test_audit_websocket.py
+1-51 files

FreeNAS/freenas 19d6571 — tests/api2 test_300_nfs.py

NAS-145438 / 28.0.0-BETA.1 / Fix flaky NFS logging test (by themylogin) (#20322)

We'll have to use NFSv3 to test logging. NFSv4 mounts only produce the
inotify-driven "v4.x client attached/detached" lines, which are racy.

Also, WARNINGs like "refused unmount not exported" pass the simple
`'rpc.mountd' in syslog_data` filter and can mess with tests results
too.

Original PR: https://github.com/truenas/middleware/pull/20321

Co-authored-by: themylogin <themylogin at gmail.com>
DeltaFile
+20-16tests/api2/test_300_nfs.py
+20-161 files

FreeNAS/freenas 57877ae — tests/api2 test_300_nfs.py

Fix flaky NFS logging test

(cherry picked from commit d932c4e14099e8f6d4852173d043fd1c8029a6fb)
DeltaFile
+20-16tests/api2/test_300_nfs.py
+20-161 files

FreeNAS/freenas ee2e15d — tests/api2 test_300_nfs.py

NAS-145438 / 27.1.0 / Fix flaky NFS logging test (#20321)

We'll have to use NFSv3 to test logging. NFSv4 mounts only produce the
inotify-driven "v4.x client attached/detached" lines, which are racy.

Also, WARNINGs like "refused unmount not exported" pass the simple
`'rpc.mountd' in syslog_data` filter and can mess with tests results
too.
DeltaFile
+20-16tests/api2/test_300_nfs.py
+20-161 files

FreeNAS/freenas d932c4e — tests/api2 test_300_nfs.py

Fix flaky NFS logging test
DeltaFile
+20-16tests/api2/test_300_nfs.py
+20-161 files

FreeNAS/freenas 823fabb — tests/api2 test_300_nfs.py

Fix flaky NFS logging test
DeltaFile
+22-16tests/api2/test_300_nfs.py
+22-161 files

FreeNAS/freenas 1fdcfa0 — src/middlewared/middlewared/plugins/zettarepl state.py __init__.py, tests/api2 test_zettarepl_state.py

NAS-145428 / 28.0.0-BETA.1 / Fix `test_deleting_task_forgets_its_state` flakiness (by themylogin) (#20319)

Original PR: https://github.com/truenas/middleware/pull/20295

Co-authored-by: themylogin <themylogin at gmail.com>
DeltaFile
+119-2tests/api2/test_zettarepl_state.py
+8-1src/middlewared/middlewared/plugins/zettarepl/state.py
+9-0src/middlewared/middlewared/plugins/zettarepl/__init__.py
+136-33 files

FreeNAS/freenas 4f161c9 — tests/api2 test_path_safety.py

NAS-145420 / 28.0.0-BETA.1 / Fix broken path security tests (#20305)

27.1 backport notes:
- test_authorized_keys_symlink_is_not_read: this branch already set the
user's home to the dataset; took master's version of that hunk

(cherry picked from commit f5a2141fd0727e659a57854723000f3cd5175774)
DeltaFile
+6-5tests/api2/test_path_safety.py
+6-51 files

FreeNAS/freenas 65d2238 — src/middlewared/middlewared/utils/libvirt storage_devices.py mixin.py, tests/api2 test_block_share_conflicts.py

Only look at `exists` when the VM device is being pointed to a new path
DeltaFile
+9-8src/middlewared/middlewared/utils/libvirt/storage_devices.py
+9-8src/middlewared/middlewared/utils/libvirt/mixin.py
+1-1tests/api2/test_block_share_conflicts.py
+19-173 files

FreeNAS/freenas 203918f — tests/api2 test_s3_bucket.py

NAS-145432 / 27.1.0 / Fix brittle S3 audit test (by themylogin) (#20316)

Original PR: https://github.com/truenas/middleware/pull/20315

Co-authored-by: themylogin <themylogin at gmail.com>
DeltaFile
+5-15tests/api2/test_s3_bucket.py
+5-151 files

FreeNAS/freenas 94e1f5e — src/middlewared/middlewared/etc_files/local/truenas-discovery/services.d TRUENAS_API.conf.py, src/middlewared/middlewared/plugins etc.py

NAS-145415 / 27.1.0 / Advertise the TrueNAS API over mDNS as _truenas-api._tcp (by william-gr) (#20309)

Advertise the TrueNAS API over mDNS as `_truenas-api._tcp`, on the web
UI's HTTPS port, so that a client such as the TrueNAS Connect app can
find a TrueNAS whatever its host name. Today a TrueNAS advertises its UI
only as `_http._tcp`, named after its host name, and nothing in that
says TrueNAS: the app keeps services whose name starts with "truenas"
and misses a renamed system.

The TXT record holds what the NAS already answers before signing in,
with the `_PLAIN` suffixes trimmed off the authentication mechanisms,
and `txtvers` first (RFC 6763 §6.7). It is 73 bytes:

```
txtvers=1
api=min=v25.10.0,max=v28.0.0
mech=API_KEY,TOKEN,PASSWORD,SCRAM
```


    [16 lines not shown]
DeltaFile
+40-0src/middlewared/middlewared/etc_files/local/truenas-discovery/services.d/TRUENAS_API.conf.py
+20-3tests/api2/test_service_announcement.py
+8-0src/middlewared/middlewared/plugins/service_/services/pseudo/misc.py
+3-0src/middlewared/middlewared/plugins/etc.py
+71-34 files

FreeNAS/freenas b172658 —

Empty commit to create PR on github.

You should reset it
DeltaFile
+0-00 files

FreeNAS/freenas 091d609 — src/middlewared/middlewared/plugins/zettarepl_ state.py, tests/api2 test_zettarepl_state.py

NAS-145428 / 27.1.0 / Fix `test_deleting_task_forgets_its_state` flakiness (#20295)
DeltaFile
+121-6tests/api2/test_zettarepl_state.py
+7-3src/middlewared/middlewared/plugins/zettarepl_/state.py
+128-92 files

FreeNAS/freenas 92a9e0e — src/middlewared/middlewared/plugins/zpool query_impl.py, src/middlewared/middlewared/pytest/unit/plugins test_zpool_query_eta.py

Match zpool status when estimating scan and expansion time remaining
DeltaFile
+95-0src/middlewared/middlewared/pytest/unit/plugins/test_zpool_query_eta.py
+15-5src/middlewared/middlewared/plugins/zpool/query_impl.py
+110-52 files

FreeNAS/freenas a195607 — src/middlewared/middlewared/plugins/failover_ remote.py

Specify harsh `TCPKeepalive` settings for the HA client
DeltaFile
+9-2src/middlewared/middlewared/plugins/failover_/remote.py
+9-21 files

FreeNAS/freenas 87d5a9d — src/middlewared/debian rules, tests/api2 test_001_ssh.py

Fix early checks tests failures
DeltaFile
+4-0src/middlewared/debian/rules
+1-1tests/api2/test_001_ssh.py
+5-12 files

FreeNAS/freenas c064db2 — tests/api2 test_s3_bucket.py

Fix brittle S3 audit test

(cherry picked from commit 00760417c215ba04598f5cc9f4b2a9e4b8b74c9d)
DeltaFile
+5-15tests/api2/test_s3_bucket.py
+5-151 files

FreeNAS/freenas cf0ec1e — tests/api2 test_s3_bucket.py

NAS-145432 / 28.0.0-BETA.1 / Fix brittle S3 audit test (#20315)
DeltaFile
+5-15tests/api2/test_s3_bucket.py
+5-151 files

FreeNAS/freenas 0076041 — tests/api2 test_s3_bucket.py

Fix brittle S3 audit test
DeltaFile
+5-15tests/api2/test_s3_bucket.py
+5-151 files