@@ -4,16 +4,16 @@
#define __TEST_H__
#include <stdbool.h>
-struct ndctl_test;
+struct test_ctx;
struct ndctl_ctx;
-struct ndctl_test *ndctl_test_new(unsigned int kver);
-int ndctl_test_result(struct ndctl_test *test, int rc);
-int ndctl_test_get_skipped(struct ndctl_test *test);
-int ndctl_test_get_attempted(struct ndctl_test *test);
-int __ndctl_test_attempt(struct ndctl_test *test, unsigned int kver,
+struct test_ctx *ndctl_test_new(unsigned int kver);
+int ndctl_test_result(struct test_ctx *test, int rc);
+int ndctl_test_get_skipped(struct test_ctx *test);
+int ndctl_test_get_attempted(struct test_ctx *test);
+int __ndctl_test_attempt(struct test_ctx *test, unsigned int kver,
const char *caller, int line);
#define ndctl_test_attempt(t, v) __ndctl_test_attempt(t, v, __func__, __LINE__)
-void __ndctl_test_skip(struct ndctl_test *test, const char *caller, int line);
+void __ndctl_test_skip(struct test_ctx *test, const char *caller, int line);
#define ndctl_test_skip(t) __ndctl_test_skip(t, __func__, __LINE__)
struct ndctl_namespace *ndctl_get_test_dev(struct ndctl_ctx *ctx);
void builtin_xaction_namespace_reset(void);
@@ -22,27 +22,27 @@ struct kmod_ctx;
struct kmod_module;
int nfit_test_init(struct kmod_ctx **ctx, struct kmod_module **mod,
struct ndctl_ctx *nd_ctx, int log_level,
- struct ndctl_test *test);
+ struct test_ctx *test);
struct ndctl_ctx;
-int test_parent_uuid(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx);
-int test_multi_pmem(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx);
+int test_parent_uuid(int loglevel, struct test_ctx *test, struct ndctl_ctx *ctx);
+int test_multi_pmem(int loglevel, struct test_ctx *test, struct ndctl_ctx *ctx);
int test_dax_directio(int dax_fd, unsigned long align, void *dax_addr, off_t offset);
-int test_dax_remap(struct ndctl_test *test, int dax_fd, unsigned long align, void *dax_addr,
+int test_dax_remap(struct test_ctx *test, int dax_fd, unsigned long align, void *dax_addr,
off_t offset, bool fsdax);
#ifdef ENABLE_POISON
-int test_dax_poison(struct ndctl_test *test, int dax_fd, unsigned long align,
+int test_dax_poison(struct test_ctx *test, int dax_fd, unsigned long align,
void *dax_addr, off_t offset, bool fsdax);
#else
-static inline int test_dax_poison(struct ndctl_test *test, int dax_fd,
+static inline int test_dax_poison(struct test_ctx *test, int dax_fd,
unsigned long align, void *dax_addr, off_t offset, bool fsdax)
{
return 0;
}
#endif
-int test_dpa_alloc(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx);
-int test_dsm_fail(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx);
-int test_libndctl(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx);
-int test_blk_namespaces(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx);
-int test_pmem_namespaces(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx);
+int test_dpa_alloc(int loglevel, struct test_ctx *test, struct ndctl_ctx *ctx);
+int test_dsm_fail(int loglevel, struct test_ctx *test, struct ndctl_ctx *ctx);
+int test_libndctl(int loglevel, struct test_ctx *test, struct ndctl_ctx *ctx);
+int test_blk_namespaces(int loglevel, struct test_ctx *test, struct ndctl_ctx *ctx);
+int test_pmem_namespaces(int loglevel, struct test_ctx *test, struct ndctl_ctx *ctx);
#endif /* __TEST_H__ */
@@ -9,7 +9,7 @@
int cmd_bat(int argc, const char **argv, struct ndctl_ctx *ctx)
{
int loglevel = LOG_DEBUG, i, rc;
- struct ndctl_test *test;
+ struct test_ctx *test;
bool force = false;
const char * const u[] = {
"ndctl bat [<options>]",
@@ -18,7 +18,7 @@ static char *result(int rc)
int cmd_test(int argc, const char **argv, struct ndctl_ctx *ctx)
{
- struct ndctl_test *test;
+ struct test_ctx *test;
int loglevel = LOG_DEBUG, i, rc;
const char * const u[] = {
"ndctl test [<options>]",
@@ -54,7 +54,7 @@ static void reset_bus(struct ndctl_bus *bus)
ndctl_dimm_zero_labels(dimm);
}
-static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test)
+static int do_test(struct ndctl_ctx *ctx, struct test_ctx *test)
{
struct ndctl_bus *bus = ndctl_bus_get_by_provider(ctx, "nfit_test.0");
struct ndctl_dimm *dimm;
@@ -91,8 +91,8 @@ out:
return rc;
}
-static int test_ack_shutdown_count_set(int loglevel, struct ndctl_test *test,
- struct ndctl_ctx *ctx)
+static int test_ack_shutdown_count_set(int loglevel, struct test_ctx *test,
+ struct ndctl_ctx *ctx)
{
struct kmod_module *mod;
struct kmod_ctx *kmod_ctx;
@@ -117,7 +117,7 @@ static int test_ack_shutdown_count_set(int loglevel, struct ndctl_test *test,
int main(int argc, char *argv[])
{
- struct ndctl_test *test = ndctl_test_new(0);
+ struct test_ctx *test = ndctl_test_new(0);
struct ndctl_ctx *ctx;
int rc;
@@ -198,8 +198,8 @@ static int ns_do_io(const char *bdev)
static const char *comm = "test-blk-namespaces";
-int test_blk_namespaces(int log_level, struct ndctl_test *test,
- struct ndctl_ctx *ctx)
+int test_blk_namespaces(int log_level, struct test_ctx *test,
+ struct ndctl_ctx *ctx)
{
char bdev[50];
int rc = -ENXIO;
@@ -337,7 +337,7 @@ int test_blk_namespaces(int log_level, struct ndctl_test *test,
int __attribute__((weak)) main(int argc, char *argv[])
{
- struct ndctl_test *test = ndctl_test_new(0);
+ struct test_ctx *test = ndctl_test_new(0);
struct ndctl_ctx *ctx;
int rc;
@@ -15,7 +15,7 @@
#define KVER_STRLEN 20
-struct ndctl_test {
+struct test_ctx {
unsigned int kver;
int attempt;
int skip;
@@ -38,9 +38,9 @@ static unsigned int get_system_kver(void)
return KERNEL_VERSION(a,b,c);
}
-struct ndctl_test *ndctl_test_new(unsigned int kver)
+struct test_ctx *ndctl_test_new(unsigned int kver)
{
- struct ndctl_test *test = calloc(1, sizeof(*test));
+ struct test_ctx *test = calloc(1, sizeof(*test));
if (!test)
return NULL;
@@ -53,7 +53,7 @@ struct ndctl_test *ndctl_test_new(unsigned int kver)
return test;
}
-int ndctl_test_result(struct ndctl_test *test, int rc)
+int ndctl_test_result(struct test_ctx *test, int rc)
{
if (ndctl_test_get_skipped(test))
fprintf(stderr, "attempted: %d skipped: %d\n",
@@ -74,8 +74,8 @@ static char *kver_str(char *buf, unsigned int kver)
return buf;
}
-int __ndctl_test_attempt(struct ndctl_test *test, unsigned int kver,
- const char *caller, int line)
+int __ndctl_test_attempt(struct test_ctx *test, unsigned int kver,
+ const char *caller, int line)
{
char requires[KVER_STRLEN], current[KVER_STRLEN];
@@ -89,26 +89,26 @@ int __ndctl_test_attempt(struct ndctl_test *test, unsigned int kver,
return 0;
}
-void __ndctl_test_skip(struct ndctl_test *test, const char *caller, int line)
+void __ndctl_test_skip(struct test_ctx *test, const char *caller, int line)
{
test->skip++;
test->attempt = test->skip;
fprintf(stderr, "%s: explicit skip %s:%d\n", __func__, caller, line);
}
-int ndctl_test_get_attempted(struct ndctl_test *test)
+int ndctl_test_get_attempted(struct test_ctx *test)
{
return test->attempt;
}
-int ndctl_test_get_skipped(struct ndctl_test *test)
+int ndctl_test_get_skipped(struct test_ctx *test)
{
return test->skip;
}
int nfit_test_init(struct kmod_ctx **ctx, struct kmod_module **mod,
struct ndctl_ctx *nd_ctx, int log_level,
- struct ndctl_test *test)
+ struct test_ctx *test)
{
int rc;
unsigned int i;
@@ -87,7 +87,7 @@ struct ndctl_namespace *ndctl_get_test_dev(struct ndctl_ctx *ctx)
return rc ? NULL : ndns;
}
-static int emit_e820_device(int loglevel, struct ndctl_test *test)
+static int emit_e820_device(int loglevel, struct test_ctx *test)
{
int err;
struct ndctl_ctx *ctx;
@@ -118,7 +118,7 @@ static int emit_e820_device(int loglevel, struct ndctl_test *test)
int __attribute__((weak)) main(int argc, char *argv[])
{
- struct ndctl_test *test = ndctl_test_new(0);
+ struct test_ctx *test = ndctl_test_new(0);
int rc;
if (!test) {
@@ -37,8 +37,9 @@ static void sigbus(int sig, siginfo_t *siginfo, void *d)
siglongjmp(sj_env, 1);
}
-int test_dax_remap(struct ndctl_test *test, int dax_fd, unsigned long align, void *dax_addr,
- off_t offset, bool fsdax)
+int test_dax_remap(struct test_ctx *test, int dax_fd, unsigned long align,
+ void *dax_addr,
+ off_t offset, bool fsdax)
{
void *anon, *remap, *addr;
struct sigaction act;
@@ -271,7 +272,7 @@ int test_dax_directio(int dax_fd, unsigned long align, void *dax_addr, off_t off
}
/* test_pmd assumes that fd references a pre-allocated + dax-capable file */
-static int test_pmd(struct ndctl_test *test, int fd)
+static int test_pmd(struct test_ctx *test, int fd)
{
unsigned long long m_align, p_align, pmd_off;
static const bool fsdax = true;
@@ -350,7 +351,7 @@ err_mmap:
int __attribute__((weak)) main(int argc, char *argv[])
{
- struct ndctl_test *test = ndctl_test_new(0);
+ struct test_ctx *test = ndctl_test_new(0);
int fd, rc;
if (!test) {
@@ -43,8 +43,8 @@ static void sigbus_hdl(int sig, siginfo_t *si, void *ptr)
siglongjmp(sj_env, 1);
}
-int test_dax_poison(struct ndctl_test *test, int dax_fd, unsigned long align,
- void *dax_addr, off_t offset, bool fsdax)
+int test_dax_poison(struct test_ctx *test, int dax_fd, unsigned long align,
+ void *dax_addr, off_t offset, bool fsdax)
{
unsigned char *addr = MAP_FAILED;
struct sigaction act;
@@ -29,7 +29,7 @@
struct check_cmd {
struct ndctl_cmd *cmd;
- struct ndctl_test *test;
+ struct test_ctx *test;
};
static sigjmp_buf sj_env;
@@ -90,7 +90,7 @@ static void sigbus(int sig, siginfo_t *siginfo, void *d)
#define VERIFY_TIME(x) (suseconds_t) ((ALIGN(x, SZ_2M) / SZ_4K) * 60)
static int verify_data(struct daxctl_dev *dev, char *dax_buf,
- unsigned long align, int salt, struct ndctl_test *test)
+ unsigned long align, int salt, struct test_ctx *test)
{
struct timeval tv1, tv2, tv_diff;
unsigned long i;
@@ -129,7 +129,7 @@ static int verify_data(struct daxctl_dev *dev, char *dax_buf,
}
static int __test_device_dax(unsigned long align, int loglevel,
- struct ndctl_test *test, struct ndctl_ctx *ctx)
+ struct test_ctx *test, struct ndctl_ctx *ctx)
{
unsigned long i;
struct sigaction act;
@@ -361,8 +361,8 @@ static int __test_device_dax(unsigned long align, int loglevel,
return rc;
}
-static int test_device_dax(int loglevel, struct ndctl_test *test,
- struct ndctl_ctx *ctx)
+static int test_device_dax(int loglevel, struct test_ctx *test,
+ struct ndctl_ctx *ctx)
{
unsigned long i, aligns[] = { SZ_4K, SZ_2M, SZ_1G };
int rc;
@@ -378,7 +378,7 @@ static int test_device_dax(int loglevel, struct ndctl_test *test,
int __attribute__((weak)) main(int argc, char *argv[])
{
- struct ndctl_test *test = ndctl_test_new(0);
+ struct test_ctx *test = ndctl_test_new(0);
struct ndctl_ctx *ctx;
int rc;
@@ -32,7 +32,7 @@ struct test_dpa_namespace {
#define MIN_SIZE SZ_4M
-static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test)
+static int do_test(struct ndctl_ctx *ctx, struct test_ctx *test)
{
unsigned int default_available_slots, available_slots, i;
struct ndctl_region *region, *blk_region = NULL;
@@ -279,7 +279,7 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test)
return 0;
}
-int test_dpa_alloc(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx)
+int test_dpa_alloc(int loglevel, struct test_ctx *test, struct ndctl_ctx *ctx)
{
struct kmod_module *mod;
struct kmod_ctx *kmod_ctx;
@@ -306,7 +306,7 @@ int test_dpa_alloc(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx)
int __attribute__((weak)) main(int argc, char *argv[])
{
- struct ndctl_test *test = ndctl_test_new(0);
+ struct test_ctx *test = ndctl_test_new(0);
struct ndctl_ctx *ctx;
int rc;
@@ -174,7 +174,7 @@ static int test_regions_enable(struct ndctl_bus *bus,
return 0;
}
-static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test)
+static int do_test(struct ndctl_ctx *ctx, struct test_ctx *test)
{
struct ndctl_bus *bus = ndctl_bus_get_by_provider(ctx, "nfit_test.0");
struct ndctl_region *region, *victim_region = NULL;
@@ -339,7 +339,7 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test)
return err;
}
-int test_dsm_fail(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx)
+int test_dsm_fail(int loglevel, struct test_ctx *test, struct ndctl_ctx *ctx)
{
struct kmod_module *mod;
struct kmod_ctx *kmod_ctx;
@@ -364,7 +364,7 @@ int test_dsm_fail(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx)
int __attribute__((weak)) main(int argc, char *argv[])
{
- struct ndctl_test *test = ndctl_test_new(0);
+ struct test_ctx *test = ndctl_test_new(0);
struct ndctl_ctx *ctx;
int rc;
@@ -613,7 +613,7 @@ static int validate_dax(struct ndctl_dax *dax)
const char *devname = ndctl_namespace_get_devname(ndns);
struct ndctl_region *region = ndctl_dax_get_region(dax);
struct ndctl_ctx *ctx = ndctl_dax_get_ctx(dax);
- struct ndctl_test *test = ndctl_get_private_data(ctx);
+ struct test_ctx *test = ndctl_get_private_data(ctx);
struct daxctl_region *dax_region = NULL, *found;
int rc = -ENXIO, fd, count, dax_expect;
struct daxctl_dev *dax_dev, *seed;
@@ -725,7 +725,7 @@ static int __check_dax_create(struct ndctl_region *region,
{
struct ndctl_dax *dax_seed = ndctl_region_get_dax_seed(region);
struct ndctl_ctx *ctx = ndctl_region_get_ctx(region);
- struct ndctl_test *test = ndctl_get_private_data(ctx);
+ struct test_ctx *test = ndctl_get_private_data(ctx);
enum ndctl_namespace_mode mode;
struct ndctl_dax *dax;
const char *devname;
@@ -835,7 +835,7 @@ static int __check_pfn_create(struct ndctl_region *region,
{
struct ndctl_pfn *pfn_seed = ndctl_region_get_pfn_seed(region);
struct ndctl_ctx *ctx = ndctl_region_get_ctx(region);
- struct ndctl_test *test = ndctl_get_private_data(ctx);
+ struct test_ctx *test = ndctl_get_private_data(ctx);
enum ndctl_namespace_mode mode;
struct ndctl_pfn *pfn;
const char *devname;
@@ -978,7 +978,7 @@ static int check_btt_size(struct ndctl_btt *btt)
unsigned long long actual, expect;
int size_select, sect_select;
struct ndctl_ctx *ctx = ndctl_btt_get_ctx(btt);
- struct ndctl_test *test = ndctl_get_private_data(ctx);
+ struct test_ctx *test = ndctl_get_private_data(ctx);
struct ndctl_namespace *ndns = ndctl_btt_get_namespace(btt);
if (!ndns)
@@ -1049,7 +1049,7 @@ static int check_btt_create(struct ndctl_region *region, struct ndctl_namespace
struct namespace *namespace)
{
struct ndctl_ctx *ctx = ndctl_region_get_ctx(region);
- struct ndctl_test *test = ndctl_get_private_data(ctx);
+ struct test_ctx *test = ndctl_get_private_data(ctx);
struct btt *btt_s = namespace->btt_settings;
int i, fd, retry = 10;
struct ndctl_btt *btt;
@@ -1257,7 +1257,7 @@ static int check_pfn_autodetect(struct ndctl_bus *bus,
struct ndctl_region *region = ndctl_namespace_get_region(ndns);
struct ndctl_ctx *ctx = ndctl_region_get_ctx(region);
const char *devname = ndctl_namespace_get_devname(ndns);
- struct ndctl_test *test = ndctl_get_private_data(ctx);
+ struct test_ctx *test = ndctl_get_private_data(ctx);
struct pfn *auto_pfn = namespace->pfn_settings;
struct ndctl_pfn *pfn, *found = NULL;
enum ndctl_namespace_mode mode;
@@ -1354,7 +1354,7 @@ static int check_dax_autodetect(struct ndctl_bus *bus,
struct ndctl_region *region = ndctl_namespace_get_region(ndns);
struct ndctl_ctx *ctx = ndctl_region_get_ctx(region);
const char *devname = ndctl_namespace_get_devname(ndns);
- struct ndctl_test *test = ndctl_get_private_data(ctx);
+ struct test_ctx *test = ndctl_get_private_data(ctx);
struct dax *auto_dax = namespace->dax_settings;
struct ndctl_dax *dax, *found = NULL;
enum ndctl_namespace_mode mode;
@@ -1439,7 +1439,7 @@ static int check_btt_autodetect(struct ndctl_bus *bus,
struct ndctl_region *region = ndctl_namespace_get_region(ndns);
struct ndctl_ctx *ctx = ndctl_region_get_ctx(region);
const char *devname = ndctl_namespace_get_devname(ndns);
- struct ndctl_test *test = ndctl_get_private_data(ctx);
+ struct test_ctx *test = ndctl_get_private_data(ctx);
struct btt *auto_btt = namespace->btt_settings;
struct ndctl_btt *btt, *found = NULL;
enum ndctl_namespace_mode mode;
@@ -1665,7 +1665,7 @@ static int check_namespaces(struct ndctl_region *region,
struct namespace **namespaces, enum ns_mode mode)
{
struct ndctl_ctx *ctx = ndctl_region_get_ctx(region);
- struct ndctl_test *test = ndctl_get_private_data(ctx);
+ struct test_ctx *test = ndctl_get_private_data(ctx);
struct ndctl_bus *bus = ndctl_region_get_bus(region);
struct ndctl_namespace **ndns_save;
struct namespace *namespace;
@@ -2028,7 +2028,7 @@ static int check_btts(struct ndctl_region *region, struct btt **btts)
struct check_cmd {
int (*check_fn)(struct ndctl_bus *bus, struct ndctl_dimm *dimm, struct check_cmd *check);
struct ndctl_cmd *cmd;
- struct ndctl_test *test;
+ struct test_ctx *test;
};
static struct check_cmd *check_cmds;
@@ -2396,7 +2396,7 @@ static int check_smart_threshold(struct ndctl_bus *bus, struct ndctl_dimm *dimm,
#define BITS_PER_LONG 32
static int check_commands(struct ndctl_bus *bus, struct ndctl_dimm *dimm,
unsigned long bus_commands, unsigned long dimm_commands,
- struct ndctl_test *test)
+ struct test_ctx *test)
{
/*
* For now, by coincidence, these are indexed in test execution
@@ -2467,7 +2467,7 @@ static int check_commands(struct ndctl_bus *bus, struct ndctl_dimm *dimm,
static int check_dimms(struct ndctl_bus *bus, struct dimm *dimms, int n,
unsigned long bus_commands, unsigned long dimm_commands,
- struct ndctl_test *test)
+ struct test_ctx *test)
{
long long dsc;
int i, j, rc;
@@ -2588,7 +2588,7 @@ static void reset_bus(struct ndctl_bus *bus)
ndctl_region_enable(region);
}
-static int do_test0(struct ndctl_ctx *ctx, struct ndctl_test *test)
+static int do_test0(struct ndctl_ctx *ctx, struct test_ctx *test)
{
struct ndctl_bus *bus = ndctl_bus_get_by_provider(ctx, NFIT_PROVIDER0);
struct ndctl_region *region;
@@ -2646,7 +2646,7 @@ static int do_test0(struct ndctl_ctx *ctx, struct ndctl_test *test)
return check_regions(bus, regions0, ARRAY_SIZE(regions0), BTT);
}
-static int do_test1(struct ndctl_ctx *ctx, struct ndctl_test *test)
+static int do_test1(struct ndctl_ctx *ctx, struct test_ctx *test)
{
struct ndctl_bus *bus = ndctl_bus_get_by_provider(ctx, NFIT_PROVIDER1);
int rc;
@@ -2670,13 +2670,13 @@ static int do_test1(struct ndctl_ctx *ctx, struct ndctl_test *test)
return check_regions(bus, regions1, ARRAY_SIZE(regions1), BTT);
}
-typedef int (*do_test_fn)(struct ndctl_ctx *ctx, struct ndctl_test *test);
+typedef int (*do_test_fn)(struct ndctl_ctx *ctx, struct test_ctx *test);
static do_test_fn do_test[] = {
do_test0,
do_test1,
};
-int test_libndctl(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx)
+int test_libndctl(int loglevel, struct test_ctx *test, struct ndctl_ctx *ctx)
{
unsigned int i;
struct kmod_module *mod;
@@ -2716,7 +2716,7 @@ int test_libndctl(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx)
int __attribute__((weak)) main(int argc, char *argv[])
{
- struct ndctl_test *test = ndctl_test_new(0);
+ struct test_ctx *test = ndctl_test_new(0);
struct ndctl_ctx *ctx;
int rc;
@@ -53,7 +53,7 @@ static void destroy_namespace(struct ndctl_namespace *ndns)
/* Check that the namespace device is gone (if it wasn't the seed) */
static int check_deleted(struct ndctl_region *region, const char *devname,
- struct ndctl_test *test)
+ struct test_ctx *test)
{
struct ndctl_namespace *ndns;
@@ -73,7 +73,7 @@ static int check_deleted(struct ndctl_region *region, const char *devname,
return 0;
}
-static int do_multi_pmem(struct ndctl_ctx *ctx, struct ndctl_test *test)
+static int do_multi_pmem(struct ndctl_ctx *ctx, struct test_ctx *test)
{
int i;
char devname[100];
@@ -238,7 +238,8 @@ static int do_multi_pmem(struct ndctl_ctx *ctx, struct ndctl_test *test)
return 0;
}
-int test_multi_pmem(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx)
+int test_multi_pmem(int loglevel, struct test_ctx *test,
+ struct ndctl_ctx *ctx)
{
struct kmod_module *mod;
struct kmod_ctx *kmod_ctx;
@@ -267,7 +268,7 @@ int test_multi_pmem(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx
int __attribute__((weak)) main(int argc, char *argv[])
{
- struct ndctl_test *test = ndctl_test_new(0);
+ struct test_ctx *test = ndctl_test_new(0);
struct ndctl_ctx *ctx;
int rc;
@@ -208,7 +208,8 @@ static int do_test(struct ndctl_ctx *ctx)
return 0;
}
-int test_parent_uuid(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx)
+int test_parent_uuid(int loglevel, struct test_ctx *test,
+ struct ndctl_ctx *ctx)
{
struct kmod_module *mod;
struct kmod_ctx *kmod_ctx;
@@ -235,7 +236,7 @@ int test_parent_uuid(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ct
int __attribute__((weak)) main(int argc, char *argv[])
{
- struct ndctl_test *test = ndctl_test_new(0);
+ struct test_ctx *test = ndctl_test_new(0);
struct ndctl_ctx *ctx;
int rc;
@@ -161,8 +161,8 @@ static int ns_do_io(const char *bdev)
static const char *comm = "test-pmem-namespaces";
-int test_pmem_namespaces(int log_level, struct ndctl_test *test,
- struct ndctl_ctx *ctx)
+int test_pmem_namespaces(int log_level, struct test_ctx *test,
+ struct ndctl_ctx *ctx)
{
struct ndctl_region *region, *pmem_region = NULL;
struct kmod_ctx *kmod_ctx = NULL;
@@ -262,7 +262,7 @@ int test_pmem_namespaces(int log_level, struct ndctl_test *test,
int __attribute__((weak)) main(int argc, char *argv[])
{
- struct ndctl_test *test = ndctl_test_new(0);
+ struct test_ctx *test = ndctl_test_new(0);
struct ndctl_ctx *ctx;
int rc;
@@ -32,8 +32,8 @@ static void sigbus(int sig, siginfo_t *siginfo, void *d)
#define err(fmt, ...) \
fprintf(stderr, "%s: " fmt, __func__, ##__VA_ARGS__)
-static int test_devmem(int loglevel, struct ndctl_test *test,
- struct ndctl_ctx *ctx)
+static int test_devmem(int loglevel, struct test_ctx *test,
+ struct ndctl_ctx *ctx)
{
void *buf;
int fd, rc;
@@ -124,7 +124,7 @@ out_devmem:
int main(int argc, char *argv[])
{
- struct ndctl_test *test = ndctl_test_new(0);
+ struct test_ctx *test = ndctl_test_new(0);
struct ndctl_ctx *ctx;
int rc;
In preparation for using the common test core for libcxl tests, rename the 'ndctl_test' structure to 'test_ctx' Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> --- test.h | 36 +++++++++++++++++------------------ ndctl/bat.c | 2 +- ndctl/test.c | 2 +- test/ack-shutdown-count-set.c | 8 ++++---- test/blk_namespaces.c | 6 +++--- test/core.c | 20 +++++++++---------- test/dax-dev.c | 4 ++-- test/dax-pmd.c | 9 +++++---- test/dax-poison.c | 4 ++-- test/daxdev-errors.c | 2 +- test/device-dax.c | 10 +++++----- test/dpa-alloc.c | 6 +++--- test/dsm-fail.c | 6 +++--- test/libndctl.c | 34 ++++++++++++++++----------------- test/multi-pmem.c | 9 +++++---- test/parent-uuid.c | 5 +++-- test/pmem_namespaces.c | 6 +++--- test/revoke-devmem.c | 6 +++--- 18 files changed, 89 insertions(+), 86 deletions(-)