libelektra: is_not_rw_storage broken

As @kodebach reported in #2419:

Yes, but that is broken, because is_not_rw_storage doesn’t work. Not even dump is recognized as a storage plugin.

Fix is_not_rw_storage in include_common.sh.in tests/shell/check_export.sh so we detect problems like this in future.

  • fix is_not_rw_storage
  • fix testscr_check_import

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 19 (19 by maintainers)

Commits related to this issue

Most upvoted comments

Thank you both 🎆

@mpranj yes, it would be appreciated if you do fixes in the PR!

Having a fixed master has of course the highest priority 🚀

I’ll look at #2595 and see what needs to be done…

The problem with is_not_rw_storage is that it checks if the output of kdb info $PLUGIN provides is equal to storage, but for a plugin to be a storage plugin the output only has to contain the word storage.

When I fixed this in my fork all of the tests that use is_not_rw_storage (that is check_export, check_import, check_get_set and check_kdb_internal_suite) started to fail.

Most of the check_export and check_import tests fail because the necessary files in tests/shell/shell don’t exist, but some fail for other reasons: the mmapstorage and mmapstorage_crc plugins fail because of permission stuff and the tcl plugin check_export tests fail because the output is incorrect. Those tests produce a lot of output so I might have missed something. I didn’t look at check_get_set and check_kdb_internal_suite yet.

This issue also applies to testscr_check_import.

I just looked at the output of testscr_check_export (called with ctest -R testscr_check_export --verbose inside the build directory):

108: Check if script tests the correct version
108: base64 not a read-write storage
108: boolean not a read-write storage
108: c not a read-write storage
[...]
108: dump not a read-write storage
[...]

The test prints one line for each plugin that was compiled and then exits successfully. (Should probably fail if no read-write storage plugin was found, because at least one is required for Elektra to function properly)

Which has to correspond to these lines from tests/shell/check_export.sh:

	if is_not_rw_storage; then
		echo "$PLUGIN not a read-write storage"
		continue
	fi

So is_not_rw_storage always returns true.