@@ -497,6 +497,66 @@ TEST_CASE("Dynamic subscriptions")
497
497
sub.terminate ();
498
498
REQUIRE_PIPE_HANGUP (sub);
499
499
}
500
+
501
+ DOCTEST_SUBCASE (" Excluded changes" )
502
+ {
503
+ auto sub = sess.yangPushOnChange (std::nullopt , std::nullopt , sysrepo::SyncOnStart::No, {sysrepo::YangPushChange::Create});
504
+
505
+ client.setItem (" /test_module:leafInt32" , " 123" );
506
+ client.applyChanges (); // excluded (create)
507
+ client.setItem (" /test_module:leafInt32" , " 124" );
508
+ client.applyChanges ();
509
+ client.setItem (" /test_module:leafInt32" , " 125" );
510
+ client.applyChanges ();
511
+
512
+ REQUIRE_YANG_PUSH_UPDATE (sub, R"( {
513
+ "ietf-yang-push:push-change-update": {
514
+ "datastore-changes": {
515
+ "yang-patch": {
516
+ "patch-id": "patch-1",
517
+ "edit": [
518
+ {
519
+ "edit-id": "edit-1",
520
+ "operation": "replace",
521
+ "target": "/test_module:leafInt32",
522
+ "value": {
523
+ "test_module:leafInt32": 124
524
+ }
525
+ }
526
+ ]
527
+ }
528
+ }
529
+ }
530
+ }
531
+ )" );
532
+
533
+ READ_YANG_PUSH_UPDATE (sub);
534
+
535
+ REQUIRE_YANG_PUSH_UPDATE (sub, R"( {
536
+ "ietf-yang-push:push-change-update": {
537
+ "datastore-changes": {
538
+ "yang-patch": {
539
+ "patch-id": "patch-2",
540
+ "edit": [
541
+ {
542
+ "edit-id": "edit-1",
543
+ "operation": "replace",
544
+ "target": "/test_module:leafInt32",
545
+ "value": {
546
+ "test_module:leafInt32": 125
547
+ }
548
+ }
549
+ ]
550
+ }
551
+ }
552
+ }
553
+ }
554
+ )" );
555
+ READ_YANG_PUSH_UPDATE (sub);
556
+
557
+ sub.terminate ();
558
+ REQUIRE_PIPE_HANGUP (sub);
559
+ }
500
560
}
501
561
502
562
DOCTEST_SUBCASE (" YANG Push periodic" )
0 commit comments