Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear test status #8486

Open
ssooffiiaannee opened this issue Feb 21, 2025 · 4 comments
Open

Unclear test status #8486

ssooffiiaannee opened this issue Feb 21, 2025 · 4 comments
Assignees
Labels

Comments

@ssooffiiaannee
Copy link

Version

5.7.2-stable

Description

After building the project, it is unclear if the tests are successful or not. And I am not sure if I am running the test correctly.

I build the project in debug mode (test building is enabled by default) :

cmake -D WOLFSSL_DEBUG=y ..

RUn the unit tests
./tests/unit.test

A unit test does not seem to succeed, maybe an issue with a client reaching a host

wolfSSL Entering SetSSL_CTX
wolfSSL Entering wolfSSL_NewSession
InitSSL done. return 0 (success)
wolfSSL_new InitSSL success
wolfSSL Leaving wolfSSL_new InitSSL =, return 0
wolfSSL Entering wolfSSL_SetEnableDhKeyTest
wolfSSL Leaving wolfSSL_SetEnableDhKeyTest, return 1
wolfSSL error: tcp connect failed: No route to host

Any thoughts on what I am doing or went wrong ?

@embhorn embhorn self-assigned this Feb 21, 2025
@embhorn
Copy link
Member

embhorn commented Feb 21, 2025

Hi @ssooffiiaannee

The instructions for building with cmake are here:

wolfssl/INSTALL

Lines 84 to 139 in 8ae1225

14. Building with CMake
Note: Primary development uses automake (./configure). The support for CMake
is still under development.
For configuring wolfssl using CMake, we recommend downloading the CMake
GUI (https://cmake.org/download/). This tool allows you to see all of
wolfssl's configuration variables, set them, and view their descriptions.
Looking at the GUI or CMakeCache.txt (generated after running cmake once) is
the best way to find out what configuration options are available and what
they do. You can also invoke CMake from the GUI, which is described in the
Windows instructions below. For Unix-based systems, we describe the command
line work flow. Regardless of your chosen workflow, cmake will generate
a header options.h in the wolfssl directory that contains the options used
to configure the build.
Note: Building with configure generates a wolfssl/options.h file that contains
all the generated build options. This file needs to be included in your application
before any other wolfSSL headers. Optionally your application can define
WOLFSSL_USE_OPTIONS_H to do this automatically.
Unix-based Platforms
---
1) Navigate to the wolfssl root directory containing "CMakeLists.txt".
2) Create a directory called "build" and change into it. This is where
CMake will store build files.
3) Run `cmake ..` to generate the target build files (e.g. UNIX Makefiles).
To enable or disable features, set them using -D<option>=[yes/no]. For
example, to disable TLS 1.3 support, run cmake .. -DWOLFSSL_TLS13=no
(autoconf equivalent: ./configure --disable-tls13) To enable DSA, run
cmake .. -DWOLFSSL_DSA=yes (autoconf equivalent: ./configure
--enable-dsa). Again, you can find a list of these options and their
descriptions either using the CMake GUI or by looking at CMakeCache.txt.
5) The build directory should now contain the generated build files. Build
with `cmake --build .`. Under the hood, this runs the target build tool
(by default, make). You can also invoke the target build tool directly
(e.g. make).
To build with debugging use: `cmake .. -DCMAKE_BUILD_TYPE=Debug`.
In the simplest form:
# create a root directory for wolfssl repo
git clone https://github.com/wolfSSL/wolfssl.git
cd wolfssl
# From the root of the wolfSSL repo:
mkdir -p out
pushd out
cmake ..
cmake --build .
# View the available ciphers with:
./examples/client/client -e
popd

From the root wolfSSL folder:

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
cmake --build .
./tests/unit.test

At the end you should see:

 Success -- All results as expected.
 End Cipher Suite Tests

unit_test: Success for all configured tests.

Thanks,
@embhorn - wolfSSL Support

@ssooffiiaannee
Copy link
Author

Thank you @embhorn

I still could not get a successful test, are you building commit tagged v5.7.2-stable ?
gcc version : gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0

SSL version is TLSv1.2
SSL cipher suite is TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
SSL curve name is SECP256R1
SSL version is TLSv1.2
SSL cipher suite is TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
SSL curve name is SECP256R1
Client message: hello wolfssl!
I hear you fa shizzle!
trying server command line[703]: SuiteTest -v 3 -l ECDHE-RSA-AES128-GCM-SHA256 -k ./certs/server-key.pem -c ./certs/test/server-goodcn.pem -d -2 -p 0
trying client command line[704]: SuiteTest -v 3 -l ECDHE-RSA-AES128-GCM-SHA256 -h localhost -A ./certs/test/server-goodcn.pem -m -C -2 -p 34133
wolfSSL error: tcp connect failed: No route to host

@embhorn
Copy link
Member

embhorn commented Feb 21, 2025

I just retested with v5.7.2 successfully.

The error log you shared is showing that the tcp connect is failing. Can you check that there are no other running instances of the test? Maybe from ctrl-C'ing the test previously?

@ssooffiiaannee
Copy link
Author

Ctrl-C did not work, I had to restart my OS to make it work, not sure what went wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants