diff --git a/Knot.files b/Knot.files
index f6cf5bfb22f1952fcb7871e571bf1be9dc204b6d..e8cc427c72a635eae244f181edda1138b86d3fe3 100644
--- a/Knot.files
+++ b/Knot.files
@@ -550,7 +550,6 @@ tests-fuzz/main.c
 tests/contrib/test_base32hex.c
 tests/contrib/test_base64.c
 tests/contrib/test_base64url.c
-tests/contrib/test_dynarray.c
 tests/contrib/test_heap.c
 tests/contrib/test_net.c
 tests/contrib/test_net_shortwrite.c
@@ -613,6 +612,7 @@ tests/libknot/test_cookies.c
 tests/libknot/test_db.c
 tests/libknot/test_descriptor.c
 tests/libknot/test_dname.c
+tests/libknot/test_dynarray.c
 tests/libknot/test_edns.c
 tests/libknot/test_edns_ecs.c
 tests/libknot/test_endian.c
diff --git a/tests/.gitignore b/tests/.gitignore
index f073e5e44d584b9828de9e11ae38b8a465295a36..932e58a12bc197b8c57bcd30a656ddf5892844c6 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -4,7 +4,6 @@
 /contrib/test_base32hex
 /contrib/test_base64
 /contrib/test_base64url
-/contrib/test_dynarray
 /contrib/test_heap
 /contrib/test_net
 /contrib/test_net_shortwrite
@@ -71,6 +70,7 @@
 /libknot/test_db
 /libknot/test_descriptor
 /libknot/test_dname
+/libknot/test_dynarray
 /libknot/test_edns
 /libknot/test_edns_ecs
 /libknot/test_endian
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6016a3fdf830afeaf166f9d40125697815a21d5e..7c18217e38bb89877a746fcd804b582107b9c571 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -51,7 +51,6 @@ check_PROGRAMS = \
 	contrib/test_base32hex			\
 	contrib/test_base64			\
 	contrib/test_base64url			\
-	contrib/test_dynarray			\
 	contrib/test_heap			\
 	contrib/test_net			\
 	contrib/test_net_shortwrite		\
@@ -140,6 +139,7 @@ check_PROGRAMS += \
 	libknot/test_db				\
 	libknot/test_descriptor			\
 	libknot/test_dname			\
+	libknot/test_dynarray			\
 	libknot/test_edns			\
 	libknot/test_edns_ecs			\
 	libknot/test_endian			\
diff --git a/tests/contrib/test_dynarray.c b/tests/libknot/test_dynarray.c
similarity index 100%
rename from tests/contrib/test_dynarray.c
rename to tests/libknot/test_dynarray.c