Skip to content
Merged
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
70 changes: 70 additions & 0 deletions src/libyang3-py3/patch/0004-pr141-test-crash.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
From 2d8dcdfb3ac67389b61f46130c27815b47c0e7e7 Mon Sep 17 00:00:00 2001
From: Brad House <[email protected]>
Date: Sun, 6 Jul 2025 16:42:00 -0400
Subject: [PATCH] tests: test_iffeature_state crash fix

As observed on Debian Trixie RC2, test_iffeature_state crashes due
to an internal pointer being invalidated. This invalidation appears
to be due to a call to lys_set_implemented() possibly causing a
full recompile of the ctx.

This simply reorders the caching of the path pointers so they are
not invalidated when used.

Signed-off-by: Brad House <[email protected]>
---
tests/test_schema.py | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/tests/test_schema.py b/tests/test_schema.py
index a310aad..4578f84 100644
--- a/tests/test_schema.py
+++ b/tests/test_schema.py
@@ -197,18 +197,8 @@ def feature_disable_only(feature):
continue
self.mod.feature_enable(f.name())

- leaf_simple = next(self.ctx.find_path("/yolo-system:conf/yolo-system:speed"))
-
- self.mod.feature_disable_all()
- leaf_not = next(self.ctx.find_path("/yolo-system:conf/yolo-system:offline"))
- self.mod.feature_enable_all()
-
- leaf_and = next(self.ctx.find_path("/yolo-system:conf/yolo-system:full"))
- leaf_or = next(
- self.ctx.find_path("/yolo-system:conf/yolo-system:isolation-level")
- )
-
# if-feature is just a feature
+ leaf_simple = next(self.ctx.find_path("/yolo-system:conf/yolo-system:speed"))
tree = next(leaf_simple.if_features()).tree()
self.mod.feature_enable_all()
self.assertEqual(tree.state(), True)
@@ -216,6 +206,8 @@ def feature_disable_only(feature):
self.assertEqual(tree.state(), False)

# if-feature is "NOT networking"
+ self.mod.feature_disable_all()
+ leaf_not = next(self.ctx.find_path("/yolo-system:conf/yolo-system:offline"))
tree = next(leaf_not.if_features()).tree()
self.mod.feature_enable_all()
self.assertEqual(tree.state(), False)
@@ -223,6 +215,8 @@ def feature_disable_only(feature):
self.assertEqual(tree.state(), True)

# if-feature is "turbo-boost AND networking"
+ self.mod.feature_enable_all()
+ leaf_and = next(self.ctx.find_path("/yolo-system:conf/yolo-system:full"))
tree = next(leaf_and.if_features()).tree()
self.mod.feature_enable_all()
self.assertEqual(tree.state(), True)
@@ -234,6 +228,9 @@ def feature_disable_only(feature):
self.assertEqual(tree.state(), False)

# if-feature is "turbo-boost OR networking"
+ leaf_or = next(
+ self.ctx.find_path("/yolo-system:conf/yolo-system:isolation-level")
+ )
tree = next(leaf_or.if_features()).tree()
self.mod.feature_enable_all()
self.assertEqual(tree.state(), True)
1 change: 1 addition & 0 deletions src/libyang3-py3/patch/series
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
0001-debian.patch
0002-pr134-json-string-datatypes.patch
0003-pr132-backlinks.patch
0004-pr141-test-crash.patch
Loading