Skip to content

Commit

Permalink
test1
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisHeimbigner committed Nov 27, 2023
1 parent 0c6fd78 commit c671b97
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

name: Run macOS-based netCDF Tests

on: [pull_request,workflow_dispatch]
on: [push,pull_request,workflow_dispatch]

concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

name: Run S3 netCDF Tests (under Ubuntu Linux)

on: [workflow_dispatch]
on: [push,workflow_dispatch]

concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

name: Run Ubuntu/Linux netCDF Tests

on: [pull_request, workflow_dispatch]
on: [push,pull_request, workflow_dispatch]

concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_win_cygwin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Run Cygwin-based tests

on: [pull_request,workflow_dispatch]
on: [push,pull_request,workflow_dispatch]

concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_win_mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: Run MSYS2, MinGW64-based Tests (Not Visual Studio)
env:
CPPFLAGS: "-D_BSD_SOURCE"

on: [pull_request,workflow_dispatch]
on: [push,pull_request,workflow_dispatch]

concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
Expand Down
3 changes: 3 additions & 0 deletions include/ncpathmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
Expand Down
3 changes: 3 additions & 0 deletions include/ncs3sdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#ifndef NCS3SDK_H
#define NCS3SDK_H 1

#define AWSHOST ".amazonaws.com"
#define GOOGLEHOST "storage.googleapis.com"

/* Track the server type, if known */
typedef enum NCS3SVC {NCS3UNK=0, /* unknown */
NCS3=1, /* s3.amazon.aws */
Expand Down
4 changes: 2 additions & 2 deletions libdispatch/dcopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ searchgrouptree(int ncid1, int tid1, int grp, int* tid2)
int gid;
uintptr_t id;

id = grp;
id = (uintptr_t)grp;
nclistpush(queue,(void*)id); /* prime the queue */
while(nclistlength(queue) > 0) {
id = (uintptr_t)nclistremove(queue,0);
Expand All @@ -712,7 +712,7 @@ searchgrouptree(int ncid1, int tid1, int grp, int* tid2)
goto done;
/* push onto the end of the queue */
for(i=0;i<nids;i++) {
id = ids[i];
id = (uintptr_t)ids[i];
nclistpush(queue,(void*)id);
}
free(ids); ids = NULL;
Expand Down
4 changes: 2 additions & 2 deletions libdispatch/derror.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ const char *nc_strerror(int ncerr1)
case NC_EMPI: return "NetCDF: MPI operation failed.";
case NC_ERCFILE:
return "NetCDF: RC File Failure.";
case NC_ENULLPAD:
case NC_ENULLPAD:
return "NetCDF: File fails strict Null-Byte Header check.";
case NC_EINMEMORY:
case NC_EINMEMORY:
return "NetCDF: In-memory File operation failed.";
case NC_ENCZARR:
return "NetCDF: NCZarr error";
Expand Down
4 changes: 2 additions & 2 deletions libdispatch/nch5s3comms.c
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ NCH5_s3comms_s3r_open(const char* root, NCS3SVC svc, const char *region, const c
/* Compute the signing key */
if (SUCCEED != NCH5_s3comms_signing_key(&signing_key, access_key, region, iso8601now))
HGOTO_ERROR(H5E_ARGS, NC_EINVAL, NULL, "problem in NCH5_s3comms_s3comms_signing_key.");
if (nulllen(signing_key)==0)
if (signing_key == NULL)
HGOTO_ERROR(H5E_ARGS, NC_EAUTH, NULL, "signing key cannot be null.");
handle->signing_key = signing_key;
signing_key = NULL;
Expand Down Expand Up @@ -2033,7 +2033,7 @@ NCH5_s3comms_signing_key(unsigned char **mdp, const char *secret, const char *re
if ((size_t)ret != (AWS4_secret_len - 1))
HGOTO_ERRORVA(H5E_ARGS, NC_EINVAL, FAIL, "problem writing AWS4+secret `%s`", secret);

if((md = (unsigned char*)malloc(SHA256_DIGEST_LENGTH))==NULL)
if((md = (unsigned char*)calloc(1,SHA256_DIGEST_LENGTH))==NULL)
HGOTO_ERROR(H5E_ARGS, NC_ENOMEM, NULL, "could not malloc space for signing key .");

/* hash_func, key, len(key), msg, len(msg), digest_dest, digest_len_dest
Expand Down
7 changes: 5 additions & 2 deletions libdispatch/nclist.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ NClist* nclistnew(void)
ncinitialized = 1;
}
*/
l = (NClist*)malloc(sizeof(NClist));
l = (NClist*)calloc(1,sizeof(NClist));
if(l) {
l->alloc=0;
l->length=0;
Expand Down Expand Up @@ -286,10 +286,13 @@ nclistclone(const NClist* l, int deep)
void*
nclistextract(NClist* l)
{
void* result = l->content;
void* result = NULL;
if(l) {
result = l->content;
l->alloc = 0;
l->length = 0;
l->content = NULL;
}
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion libncpoco/cp_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static void
ncperr(const char* fcn, NCPSharedLib* lib)
{
const char* msg = dlerror();
lib->err.msg[0] = '\0';
memset(lib->err.msg,0,sizeof(lib->err.msg));
if(msg != NULL) {
strlcat(lib->err.msg,fcn,sizeof(lib->err.msg));
strlcat(lib->err.msg,": ",sizeof(lib->err.msg));
Expand Down
5 changes: 2 additions & 3 deletions libncpoco/cp_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,9 @@ load(NCPSharedLib* lib , const char* path0, int flags)
char* msg = NULL;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, errcode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), &msg, 0, NULL);
if(msg) {
memset(lib->err.msg,0,sizeof(lib->err.msg));
if(msg)
strncpy(lib->err.msg,msg,sizeof(lib->err.msg));
} else
lib->err.msg[0] = '\0';
ret = NC_ENOTFOUND;
goto ldone;
}
Expand Down
11 changes: 11 additions & 0 deletions libncpoco/ncpoco.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ EXTERNL int
ncpload(NCPSharedLib* lib, const char* path, int flags)
{
if(lib == NULL || path == NULL) return NC_EINVAL;
ncpclearerrmsg(lib);
return lib->api.load(lib,path,flags);
}

EXTERNL int
ncpunload(NCPSharedLib* lib) /* Unloads a shared library. */
{
if(lib == NULL) return NC_EINVAL;
ncpclearerrmsg(lib);
return lib->api.unload(lib);
}

Expand All @@ -93,6 +95,7 @@ EXTERNL void*
ncpgetsymbol(NCPSharedLib* lib,const char* name)
{
if(lib == NULL) return NULL;
ncpclearerrmsg(lib);
return lib->api.getsymbol(lib,name);
}

Expand All @@ -113,3 +116,11 @@ ncpgeterrmsg(NCPSharedLib* lib)
if(lib == NULL) return NULL;
return (lib->err.msg[0] == '\0' ? NULL : lib->err.msg);
}

/* Clear the last err msg. */
EXTERNL void
ncpclearerrmsg(NCPSharedLib* lib)
{
if(lib == NULL) return;
memset(lib->err.msg,0,sizeof(lib->err.msg));
}
3 changes: 3 additions & 0 deletions libncpoco/ncpoco.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ EXTERNL const char* ncpgetpath(NCPSharedLib*);
/* Return last err msg */
EXTERNL const char* ncpgeterrmsg(NCPSharedLib* lib);

/* Clear the last err msg. */
EXTERNL void ncpclearerrmsg(NCPSharedLib* lib);

EXTERNL const char* intstr(int err1);

#endif /*NCPOCO_H*/
14 changes: 7 additions & 7 deletions libsrc/v1hpg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ NC_computeshapes(NC3_INFO* ncp)
for( /*NADA*/; vpp < end; vpp++)
{
status = NC_var_shape(*vpp, &ncp->dims);
if(status != NC_NOERR)
if(status != NC_NOERR)
return(status);

if(IS_RECVAR(*vpp))
Expand All @@ -1265,13 +1265,13 @@ NC_computeshapes(NC3_INFO* ncp)
}
else
{
if(first_var == NULL)
if(first_var == NULL)
first_var = *vpp;
/*
* Overwritten each time thru.
* Usually overwritten in first_rec != NULL clause below.
*/
ncp->begin_rec = (*vpp)->begin + (off_t)(*vpp)->len;
/*
* Overwritten each time thru.
* Usually overwritten in first_rec != NULL clause below.
*/
ncp->begin_rec = (*vpp)->begin + (off_t)(*vpp)->len;
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion s3gc.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ if ! aws s3api list-objects-v2 --bucket ${S3TESTBUCKET} --prefix "${S3TESTSUBTRE
fi
aws s3api list-objects-v2 --bucket ${S3TESTBUCKET} --prefix "${S3TESTSUBTREE}" | grep -F '"Key":' >s3gc.keys
while read -r line; do
KEY=`echo "$line" | sed -e 's|[^"]*"Key":[^"]*"\([^"]*\)".*|\1|'`
KEY0=`echo "$line" | sed -e 's|[^"]*"Key":[^"]*"\([^"]*\)".*|\1|'`
# Strip off any leading '/'
KEY=`echo "$KEY0" | sed -e 's|^[/]*\(.*\)|\1|'`
# Ignore keys that do not start with ${S3TESTSUBTREE}
PREFIX=`echo "$KEY" | sed -e 's|\([^/]*\)/.*|\1|'`
if test "x$PREFIX" = "x$S3TESTSUBTREE" ; then
Expand Down

0 comments on commit c671b97

Please sign in to comment.