mirror of https://github.com/wolfSSL/wolfssh.git
Fix testsuite with singlethreaded
parent
4dabe1cb94
commit
0719578e29
|
@ -0,0 +1,75 @@
|
||||||
|
name: Single-thread Check Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ '*' ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ '*' ]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
WOLFSSL_REF: v5.7.0-stable
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_wolfssl:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ ubuntu-latest, macos-latest ]
|
||||||
|
name: Build wolfssl
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 4
|
||||||
|
steps:
|
||||||
|
- name: Checking cache for wolfssl
|
||||||
|
uses: actions/cache@v4
|
||||||
|
id: cache-wolfssl
|
||||||
|
with:
|
||||||
|
path: build-dir/
|
||||||
|
key: wolfssh-singlethread-check-wolfssl-${{ env.WOLFSSL_REF }}-${{ matrix.os }}
|
||||||
|
lookup-only: true
|
||||||
|
|
||||||
|
- name: Checkout, build, and install wolfssl
|
||||||
|
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
|
||||||
|
uses: wolfSSL/actions-build-autotools-project@v1
|
||||||
|
with:
|
||||||
|
repository: wolfssl/wolfssl
|
||||||
|
ref: ${{ env.WOLFSSL_REF }}
|
||||||
|
path: wolfssl
|
||||||
|
configure: --enable-wolfssh --enable-singlethreaded --enable-keygen
|
||||||
|
check: false
|
||||||
|
install: true
|
||||||
|
|
||||||
|
build_wolfssh:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ ubuntu-latest, macos-latest ]
|
||||||
|
config: [
|
||||||
|
'',
|
||||||
|
'--enable-all',
|
||||||
|
'--enable-sftp',
|
||||||
|
'--enable-scp',
|
||||||
|
'--enable-shell',
|
||||||
|
]
|
||||||
|
name: Build wolfssh
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 4
|
||||||
|
needs: build_wolfssl
|
||||||
|
steps:
|
||||||
|
- name: Checking cache for wolfssl
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: build-dir/
|
||||||
|
key: wolfssh-singlethread-check-wolfssl-${{ env.WOLFSSL_REF }}-${{ matrix.os }}
|
||||||
|
fail-on-cache-miss: true
|
||||||
|
|
||||||
|
- name: Checkout, build, and test wolfssh
|
||||||
|
uses: wolfSSL/actions-build-autotools-project@v1
|
||||||
|
with:
|
||||||
|
repository: wolfssl/wolfssh
|
||||||
|
path: wolfssh
|
||||||
|
configure: ${{ matrix.config }} LDFLAGS="-L${{ github.workspace }}/build-dir/lib" CPPFLAGS="-I${{ github.workspace }}/build-dir/include"
|
||||||
|
check: true
|
|
@ -106,14 +106,6 @@ static const char* caCert = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(WOLFSSH_AGENT)
|
|
||||||
static inline void ato32(const byte* c, word32* u32)
|
|
||||||
{
|
|
||||||
*u32 = (c[0] << 24) | (c[1] << 16) | (c[2] << 8) | c[3];
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static int NonBlockSSH_connect(WOLFSSH* ssh)
|
static int NonBlockSSH_connect(WOLFSSH* ssh)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -215,6 +207,13 @@ static void modes_reset(void)
|
||||||
|
|
||||||
#if !defined(SINGLE_THREADED) && !defined(WOLFSSL_NUCLEUS)
|
#if !defined(SINGLE_THREADED) && !defined(WOLFSSL_NUCLEUS)
|
||||||
|
|
||||||
|
#if defined(WOLFSSH_AGENT)
|
||||||
|
static inline void ato32(const byte* c, word32* u32)
|
||||||
|
{
|
||||||
|
*u32 = (c[0] << 24) | (c[1] << 16) | (c[2] << 8) | c[3];
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct thread_args {
|
typedef struct thread_args {
|
||||||
WOLFSSH* ssh;
|
WOLFSSH* ssh;
|
||||||
wolfSSL_Mutex lock;
|
wolfSSL_Mutex lock;
|
||||||
|
@ -1023,14 +1022,14 @@ static THREAD_RETURN WOLFSSH_THREAD wolfSSH_Client(void* args)
|
||||||
if (ret != WS_SUCCESS)
|
if (ret != WS_SUCCESS)
|
||||||
err_sys("Couldn't connect SSH stream.");
|
err_sys("Couldn't connect SSH stream.");
|
||||||
|
|
||||||
|
MODES_CLEAR();
|
||||||
|
|
||||||
#if !defined(SINGLE_THREADED) && !defined(WOLFSSL_NUCLEUS)
|
#if !defined(SINGLE_THREADED) && !defined(WOLFSSL_NUCLEUS)
|
||||||
#if 0
|
#if 0
|
||||||
if (keepOpen) /* set up for psuedo-terminal */
|
if (keepOpen) /* set up for psuedo-terminal */
|
||||||
ClientSetEcho(2);
|
ClientSetEcho(2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MODES_CLEAR();
|
|
||||||
|
|
||||||
if (config.command != NULL || keepOpen == 1) {
|
if (config.command != NULL || keepOpen == 1) {
|
||||||
#if defined(_POSIX_THREADS)
|
#if defined(_POSIX_THREADS)
|
||||||
thread_args arg;
|
thread_args arg;
|
||||||
|
|
|
@ -38,8 +38,9 @@
|
||||||
|
|
||||||
#ifdef WOLFSSH_SFTP
|
#ifdef WOLFSSH_SFTP
|
||||||
#define WOLFSSH_TEST_LOCKING
|
#define WOLFSSH_TEST_LOCKING
|
||||||
#define WOLFSSH_TEST_THREADING
|
#ifndef SINGLE_THREADED
|
||||||
|
#define WOLFSSH_TEST_THREADING
|
||||||
|
#endif
|
||||||
#define WOLFSSH_TEST_SERVER
|
#define WOLFSSH_TEST_SERVER
|
||||||
#define WOLFSSH_TEST_ECHOSERVER
|
#define WOLFSSH_TEST_ECHOSERVER
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -23,6 +23,11 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#ifdef WOLFSSL_USER_SETTINGS
|
||||||
|
#include <wolfssl/wolfcrypt/settings.h>
|
||||||
|
#else
|
||||||
|
#include <wolfssl/options.h>
|
||||||
|
#endif
|
||||||
#include <wolfssh/settings.h>
|
#include <wolfssh/settings.h>
|
||||||
|
|
||||||
#if defined(WOLFSSH_SFTP) && !defined(SINGLE_THREADED)
|
#if defined(WOLFSSH_SFTP) && !defined(SINGLE_THREADED)
|
||||||
|
|
|
@ -22,12 +22,6 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define WOLFSSH_TEST_CLIENT
|
|
||||||
#define WOLFSSH_TEST_SERVER
|
|
||||||
#define WOLFSSH_TEST_THREADING
|
|
||||||
#define WOLFSSH_TEST_LOCKING
|
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef WOLFSSL_USER_SETTINGS
|
#ifdef WOLFSSL_USER_SETTINGS
|
||||||
|
@ -36,6 +30,13 @@
|
||||||
#include <wolfssl/options.h>
|
#include <wolfssl/options.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define WOLFSSH_TEST_CLIENT
|
||||||
|
#define WOLFSSH_TEST_SERVER
|
||||||
|
#ifndef SINGLE_THREADED
|
||||||
|
#define WOLFSSH_TEST_THREADING
|
||||||
|
#endif
|
||||||
|
#define WOLFSSH_TEST_LOCKING
|
||||||
|
|
||||||
#include <wolfssh/settings.h>
|
#include <wolfssh/settings.h>
|
||||||
#include <wolfssh/ssh.h>
|
#include <wolfssh/ssh.h>
|
||||||
#include <wolfssh/test.h>
|
#include <wolfssh/test.h>
|
||||||
|
|
Loading…
Reference in New Issue