Convert wolf-py-tests inc files to declarative syntax so test installs apply when included via wolfssl_conditional_require

pull/173/head
night1rider 2026-07-23 20:11:06 -06:00
parent 8c8628ca5d
commit 258de30963
6 changed files with 54 additions and 142 deletions

View File

@ -1,33 +1,19 @@
# Enable test directory installation for wolfcrypt-py
#
# This include file configures wolfcrypt-py to install its test directory
# to the target system for running Python binding tests.
# Declarative on purpose: this inc is included by wolfssl_conditional_require()
# from an anonymous function, and python () blocks registered that late never
# run. FILES uses the literal package name because expandKeys() has already run.
WOLFCRYPT_PY_TEST_DIR = "${S}"
WOLFCRYPT_PY_DIR = "/home/root/wolf-py-tests/wolfcrypt-py-test"
WOLFCRYPT_PY_TEST_TARGET_DIR = "${D}${WOLFCRYPT_PY_DIR}"
python () {
distro_version = d.getVar('DISTRO_VERSION', True)
wolfcrypt_py_test_dir = d.getVar('WOLFCRYPT_PY_TEST_DIR', True)
wolfcrypt_py_test_target_dir = d.getVar('WOLFCRYPT_PY_TEST_TARGET_DIR', True)
installDirCmd = 'install -m 0755 -d "%s"\n' % wolfcrypt_py_test_target_dir
cpWolfcryptPyTestCmd = 'cp -r %s/* %s\n' % (wolfcrypt_py_test_dir, wolfcrypt_py_test_target_dir)
d.appendVar('do_install', installDirCmd)
d.appendVar('do_install', cpWolfcryptPyTestCmd)
pn = d.getVar('PN', True)
wolfcrypt_py_dir = d.getVar('WOLFCRYPT_PY_DIR', True)
# Legacy always uses underscore syntax
files_var_name = 'FILES_' + pn
current_files = d.getVar(files_var_name, True) or ""
new_files = current_files + ' ' + wolfcrypt_py_dir + '/*'
d.setVar(files_var_name, new_files)
do_install_append() {
install -m 0755 -d "${WOLFCRYPT_PY_TEST_TARGET_DIR}"
cp -r ${WOLFCRYPT_PY_TEST_DIR}/* ${WOLFCRYPT_PY_TEST_TARGET_DIR}
}
FILES_wolfcrypt-py += "${WOLFCRYPT_PY_DIR}/*"
# Python Specific option
export PYTHONDONTWRITEBYTECODE = "1"

View File

@ -1,35 +1,19 @@
# Enable test directory installation for wolfcrypt-py
#
# This include file configures wolfcrypt-py to install its test directory
# to the target system for running Python binding tests.
# Declarative on purpose: this inc is included by wolfssl_conditional_require()
# from an anonymous function, and python () blocks registered that late never
# run. FILES uses the literal package name because expandKeys() has already run.
WOLFCRYPT_PY_TEST_DIR = "${S}"
WOLFCRYPT_PY_DIR = "/home/root/wolf-py-tests/wolfcrypt-py-test"
WOLFCRYPT_PY_TEST_TARGET_DIR = "${D}${WOLFCRYPT_PY_DIR}"
python () {
distro_version = d.getVar('DISTRO_VERSION', True)
wolfcrypt_py_test_dir = d.getVar('WOLFCRYPT_PY_TEST_DIR', True)
wolfcrypt_py_test_target_dir = d.getVar('WOLFCRYPT_PY_TEST_TARGET_DIR', True)
installDirCmd = 'install -m 0755 -d "%s"\n' % wolfcrypt_py_test_target_dir
cpWolfcryptPyTestCmd = 'cp -r %s/* %s\n' % (wolfcrypt_py_test_dir, wolfcrypt_py_test_target_dir)
d.appendVar('do_install', installDirCmd)
d.appendVar('do_install', cpWolfcryptPyTestCmd)
pn = d.getVar('PN', True)
wolfcrypt_py_dir = d.getVar('WOLFCRYPT_PY_DIR', True)
if distro_version and (distro_version.startswith('2.') or distro_version.startswith('3.')):
files_var_name = 'FILES_' + pn
else:
files_var_name = 'FILES:' + pn
current_files = d.getVar(files_var_name, True) or ""
new_files = current_files + ' ' + wolfcrypt_py_dir + '/*'
d.setVar(files_var_name, new_files)
do_install:append() {
install -m 0755 -d "${WOLFCRYPT_PY_TEST_TARGET_DIR}"
cp -r ${WOLFCRYPT_PY_TEST_DIR}/* ${WOLFCRYPT_PY_TEST_TARGET_DIR}
}
FILES:wolfcrypt-py += "${WOLFCRYPT_PY_DIR}/*"
# Python Specific option
export PYTHONDONTWRITEBYTECODE = "1"

View File

@ -1,5 +1,9 @@
# Configuration to enable wolf-py-tests support in wolfssl
# Python tests may need specific features enabled
#
# Declarative on purpose: this inc is included by wolfssl_conditional_require()
# from an anonymous function, and python () blocks registered that late never
# run. FILES uses the literal package name because expandKeys() has already run.
EXTRA_OECONF += "--enable-shared"
WOLFSSL_PY_TEST_CERTS_DIR = "/home/root/wolf-py-tests/certs"
@ -7,27 +11,11 @@ WOLFSSL_PY_CERTS_DIR = "/certs"
WOLFSSL_PY_CERTS_INSTALL_DIR = "${D}${WOLFSSL_PY_TEST_CERTS_DIR}"
WOLFSSL_PY_CERTS_SOURCE_DIR = "${S}${WOLFSSL_PY_CERTS_DIR}"
python () {
distro_version = d.getVar('DISTRO_VERSION', True)
wolfssl_py_certs_install_dir = d.getVar('WOLFSSL_PY_CERTS_INSTALL_DIR', True)
wolfssl_py_certs_source_dir = d.getVar('WOLFSSL_PY_CERTS_SOURCE_DIR', True)
bbnote = 'bbnote "Installing Certs Directory for wolf-py Tests"\n'
installDir = 'install -m 0755 -d "%s"\n' % (wolfssl_py_certs_install_dir)
cpDer = 'cp -r %s/*.der %s\n' % (wolfssl_py_certs_source_dir, wolfssl_py_certs_install_dir)
cpPem = 'cp -r %s/*.pem %s\n' % (wolfssl_py_certs_source_dir, wolfssl_py_certs_install_dir)
d.appendVar('do_install', bbnote)
d.appendVar('do_install', installDir)
d.appendVar('do_install', cpDer)
d.appendVar('do_install', cpPem)
pn = d.getVar('PN', True)
wolfssl_py_test_certs_dir = d.getVar('WOLFSSL_PY_TEST_CERTS_DIR', True)
# Legacy always uses underscore syntax
files_var_name = 'FILES_' + pn
current_files = d.getVar(files_var_name, True) or ""
new_files = current_files + ' ' + wolfssl_py_test_certs_dir + '/*'
d.setVar(files_var_name, new_files)
do_install_append() {
bbnote "Installing Certs Directory for wolf-py Tests"
install -m 0755 -d "${WOLFSSL_PY_CERTS_INSTALL_DIR}"
cp -r ${WOLFSSL_PY_CERTS_SOURCE_DIR}/*.der ${WOLFSSL_PY_CERTS_INSTALL_DIR}
cp -r ${WOLFSSL_PY_CERTS_SOURCE_DIR}/*.pem ${WOLFSSL_PY_CERTS_INSTALL_DIR}
}
FILES_wolfssl += "${WOLFSSL_PY_TEST_CERTS_DIR}/*"

View File

@ -1,5 +1,9 @@
# Configuration to enable wolf-py-tests support in wolfssl
# Python tests may need specific features enabled
#
# Declarative on purpose: this inc is included by wolfssl_conditional_require()
# from an anonymous function, and python () blocks registered that late never
# run. FILES uses the literal package name because expandKeys() has already run.
EXTRA_OECONF += "--enable-shared"
WOLFSSL_PY_TEST_CERTS_DIR = "/home/root/wolf-py-tests/certs"
@ -7,29 +11,11 @@ WOLFSSL_PY_CERTS_DIR = "/certs"
WOLFSSL_PY_CERTS_INSTALL_DIR = "${D}${WOLFSSL_PY_TEST_CERTS_DIR}"
WOLFSSL_PY_CERTS_SOURCE_DIR = "${S}${WOLFSSL_PY_CERTS_DIR}"
python () {
distro_version = d.getVar('DISTRO_VERSION', True)
wolfssl_py_certs_install_dir = d.getVar('WOLFSSL_PY_CERTS_INSTALL_DIR', True)
wolfssl_py_certs_source_dir = d.getVar('WOLFSSL_PY_CERTS_SOURCE_DIR', True)
bbnote = 'bbnote "Installing Certs Directory for wolf-py Tests"\n'
installDir = 'install -m 0755 -d "%s"\n' % (wolfssl_py_certs_install_dir)
cpDer = 'cp -r %s/*.der %s\n' % (wolfssl_py_certs_source_dir, wolfssl_py_certs_install_dir)
cpPem = 'cp -r %s/*.pem %s\n' % (wolfssl_py_certs_source_dir, wolfssl_py_certs_install_dir)
d.appendVar('do_install', bbnote)
d.appendVar('do_install', installDir)
d.appendVar('do_install', cpDer)
d.appendVar('do_install', cpPem)
pn = d.getVar('PN', True)
wolfssl_py_test_certs_dir = d.getVar('WOLFSSL_PY_TEST_CERTS_DIR', True)
if distro_version and (distro_version.startswith('2.') or distro_version.startswith('3.')):
files_var_name = 'FILES_' + pn
else:
files_var_name = 'FILES:' + pn
current_files = d.getVar(files_var_name, True) or ""
new_files = current_files + ' ' + wolfssl_py_test_certs_dir + '/*'
d.setVar(files_var_name, new_files)
do_install:append() {
bbnote "Installing Certs Directory for wolf-py Tests"
install -m 0755 -d "${WOLFSSL_PY_CERTS_INSTALL_DIR}"
cp -r ${WOLFSSL_PY_CERTS_SOURCE_DIR}/*.der ${WOLFSSL_PY_CERTS_INSTALL_DIR}
cp -r ${WOLFSSL_PY_CERTS_SOURCE_DIR}/*.pem ${WOLFSSL_PY_CERTS_INSTALL_DIR}
}
FILES:wolfssl += "${WOLFSSL_PY_TEST_CERTS_DIR}/*"

View File

@ -1,34 +1,19 @@
# Enable test directory installation for wolfssl-py
#
# This include file configures wolfssl-py to install its test directory
# to the target system for running Python binding tests.
# Declarative on purpose: this inc is included by wolfssl_conditional_require()
# from an anonymous function, and python () blocks registered that late never
# run. FILES uses the literal package name because expandKeys() has already run.
WOLFSSL_PY_TEST_DIR = "${S}"
WOLFSSL_PY_DIR = "/home/root/wolf-py-tests/wolfssl-py-test"
WOLFSSL_PY_TEST_TARGET_DIR = "${D}${WOLFSSL_PY_DIR}"
python () {
distro_version = d.getVar('DISTRO_VERSION', True)
wolfssl_py_test_dir = d.getVar('WOLFSSL_PY_TEST_DIR', True)
wolfssl_py_test_target_dir = d.getVar('WOLFSSL_PY_TEST_TARGET_DIR', True)
installDir = 'install -m 0755 -d "%s"\n' % (wolfssl_py_test_target_dir)
cpWolfsslPyTest = 'cp -r %s/* %s\n' % (wolfssl_py_test_dir, wolfssl_py_test_target_dir)
d.appendVar('do_install', installDir)
d.appendVar('do_install', cpWolfsslPyTest)
# Append to FILES_${PN} within the Python function
pn = d.getVar('PN', True)
wolfssl_py_dir = d.getVar('WOLFSSL_PY_DIR', True)
# Legacy always uses underscore syntax
files_var_name = 'FILES_' + pn
current_files = d.getVar(files_var_name, True) or ""
new_files = current_files + ' ' + wolfssl_py_dir + '/*'
d.setVar(files_var_name, new_files)
do_install_append() {
install -m 0755 -d "${WOLFSSL_PY_TEST_TARGET_DIR}"
cp -r ${WOLFSSL_PY_TEST_DIR}/* ${WOLFSSL_PY_TEST_TARGET_DIR}
}
FILES_wolfssl-py += "${WOLFSSL_PY_DIR}/*"
# Python Specific option
export PYTHONDONTWRITEBYTECODE = "1"

View File

@ -1,36 +1,19 @@
# Enable test directory installation for wolfssl-py
#
# This include file configures wolfssl-py to install its test directory
# to the target system for running Python binding tests.
# Declarative on purpose: this inc is included by wolfssl_conditional_require()
# from an anonymous function, and python () blocks registered that late never
# run. FILES uses the literal package name because expandKeys() has already run.
WOLFSSL_PY_TEST_DIR = "${S}"
WOLFSSL_PY_DIR = "/home/root/wolf-py-tests/wolfssl-py-test"
WOLFSSL_PY_TEST_TARGET_DIR = "${D}${WOLFSSL_PY_DIR}"
python () {
distro_version = d.getVar('DISTRO_VERSION', True)
wolfssl_py_test_dir = d.getVar('WOLFSSL_PY_TEST_DIR', True)
wolfssl_py_test_target_dir = d.getVar('WOLFSSL_PY_TEST_TARGET_DIR', True)
installDir = 'install -m 0755 -d "%s"\n' % (wolfssl_py_test_target_dir)
cpWolfsslPyTest = 'cp -r %s/* %s\n' % (wolfssl_py_test_dir, wolfssl_py_test_target_dir)
d.appendVar('do_install', installDir)
d.appendVar('do_install', cpWolfsslPyTest)
# Append to FILES:${PN} within the Python function
pn = d.getVar('PN', True)
wolfssl_py_dir = d.getVar('WOLFSSL_PY_DIR', True)
if distro_version and (distro_version.startswith('2.') or distro_version.startswith('3.')):
files_var_name = 'FILES_' + pn
else:
files_var_name = 'FILES:' + pn
current_files = d.getVar(files_var_name, True) or ""
new_files = current_files + ' ' + wolfssl_py_dir + '/*'
d.setVar(files_var_name, new_files)
do_install:append() {
install -m 0755 -d "${WOLFSSL_PY_TEST_TARGET_DIR}"
cp -r ${WOLFSSL_PY_TEST_DIR}/* ${WOLFSSL_PY_TEST_TARGET_DIR}
}
FILES:wolfssl-py += "${WOLFSSL_PY_DIR}/*"
# Python Specific option
export PYTHONDONTWRITEBYTECODE = "1"