2023-02-09 07:00:01 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* apps/testing/drivertest/drivertest_block.c
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
2023-06-07 09:14:53 +02:00
|
|
|
#include <nuttx/cache.h>
|
|
|
|
#include <nuttx/crc32.h>
|
|
|
|
#include <nuttx/mtd/mtd.h>
|
2023-02-09 07:00:01 +01:00
|
|
|
|
|
|
|
#include <sys/mount.h>
|
|
|
|
#include <sys/ioctl.h>
|
2023-05-15 14:21:37 +02:00
|
|
|
#include <sys/stat.h>
|
2023-06-05 08:07:04 +02:00
|
|
|
#include <sys/types.h>
|
2023-02-09 07:00:01 +01:00
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <setjmp.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <malloc.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <cmocka.h>
|
2023-06-07 09:14:53 +02:00
|
|
|
|
|
|
|
#include "inode/inode.h"
|
|
|
|
#include "driver/driver.h"
|
2023-02-09 07:00:01 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Type
|
|
|
|
****************************************************************************/
|
|
|
|
|
2023-06-05 08:07:04 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#define SECTORS_RANGE 0.95
|
|
|
|
|
2023-02-09 07:00:01 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Private Types
|
|
|
|
****************************************************************************/
|
|
|
|
|
2023-05-15 14:21:37 +02:00
|
|
|
struct pre_build_s
|
2023-02-09 07:00:01 +01:00
|
|
|
{
|
2023-06-07 09:14:53 +02:00
|
|
|
FAR struct inode *driver;
|
2023-05-15 14:21:37 +02:00
|
|
|
FAR const char *source;
|
2023-06-07 09:14:53 +02:00
|
|
|
struct mtd_geometry_s geo;
|
2023-05-15 14:21:37 +02:00
|
|
|
struct geometry cfg;
|
2023-02-09 07:00:01 +01:00
|
|
|
int fd;
|
|
|
|
};
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: show_usage
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static void show_usage(FAR const char *progname, int exitcode)
|
|
|
|
{
|
2023-05-15 14:21:37 +02:00
|
|
|
printf("Usage: %s -m <source>\n", progname);
|
2023-02-09 07:00:01 +01:00
|
|
|
printf("Where:\n");
|
2023-05-15 14:21:37 +02:00
|
|
|
printf(" -m <source> Block device or mtd device"
|
|
|
|
" mount location.\n");
|
2023-02-09 07:00:01 +01:00
|
|
|
exit(exitcode);
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: parse_commandline
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static void parse_commandline(int argc, FAR char **argv,
|
2023-05-15 14:21:37 +02:00
|
|
|
FAR struct pre_build_s *pre)
|
2023-02-09 07:00:01 +01:00
|
|
|
{
|
|
|
|
int option;
|
|
|
|
|
2023-05-15 14:21:37 +02:00
|
|
|
pre->source = NULL;
|
|
|
|
|
2023-02-09 07:00:01 +01:00
|
|
|
while ((option = getopt(argc, argv, "m:")) != ERROR)
|
|
|
|
{
|
|
|
|
switch (option)
|
|
|
|
{
|
|
|
|
case 'm':
|
2023-05-15 14:21:37 +02:00
|
|
|
pre->source = optarg;
|
2023-02-09 07:00:01 +01:00
|
|
|
break;
|
|
|
|
case '?':
|
|
|
|
printf("Unknown option: %c\n", optopt);
|
|
|
|
show_usage(argv[0], EXIT_FAILURE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2023-05-15 14:21:37 +02:00
|
|
|
|
|
|
|
if (pre->source == NULL)
|
|
|
|
{
|
|
|
|
printf("Missing <source>\n");
|
|
|
|
show_usage(argv[0], EXIT_FAILURE);
|
|
|
|
}
|
2023-02-09 07:00:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: blktest_randchar
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static inline char blktest_randchar(void)
|
|
|
|
{
|
|
|
|
int value = rand() % 63;
|
|
|
|
if (value == 0)
|
|
|
|
{
|
|
|
|
return '0';
|
|
|
|
}
|
|
|
|
else if (value <= 10)
|
|
|
|
{
|
|
|
|
return value + '0' - 1;
|
|
|
|
}
|
|
|
|
else if (value <= 36)
|
|
|
|
{
|
|
|
|
return value + 'a' - 11;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return value + 'A' - 37;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: blktest_randcontext
|
|
|
|
****************************************************************************/
|
|
|
|
|
2023-06-07 09:14:53 +02:00
|
|
|
static void blktest_randcontext(uint32_t size, FAR void *input)
|
2023-02-09 07:00:01 +01:00
|
|
|
{
|
2023-06-05 08:07:04 +02:00
|
|
|
/* Construct a buffer here and fill it with random characters */
|
|
|
|
|
2023-02-09 07:00:01 +01:00
|
|
|
int i;
|
2023-06-07 09:14:53 +02:00
|
|
|
FAR char *tmp;
|
|
|
|
tmp = input;
|
|
|
|
for (i = 0; i < size - 1; i++)
|
2023-02-09 07:00:01 +01:00
|
|
|
{
|
2023-06-07 09:14:53 +02:00
|
|
|
tmp[i] = blktest_randchar();
|
2023-02-09 07:00:01 +01:00
|
|
|
}
|
2023-05-15 14:21:37 +02:00
|
|
|
|
2023-06-07 09:14:53 +02:00
|
|
|
tmp[i] = '\0';
|
2023-02-09 07:00:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
2023-06-07 09:14:53 +02:00
|
|
|
* Name: setup_bch
|
2023-02-09 07:00:01 +01:00
|
|
|
****************************************************************************/
|
|
|
|
|
2023-06-07 09:14:53 +02:00
|
|
|
static int setup_bch(FAR void **state)
|
2023-02-09 07:00:01 +01:00
|
|
|
{
|
2023-06-05 08:07:04 +02:00
|
|
|
FAR struct pre_build_s *pre = *state;
|
2023-05-15 14:21:37 +02:00
|
|
|
struct stat mode;
|
2023-02-09 07:00:01 +01:00
|
|
|
time_t t;
|
2023-05-15 14:21:37 +02:00
|
|
|
int ret;
|
2023-02-09 07:00:01 +01:00
|
|
|
|
2023-05-15 14:21:37 +02:00
|
|
|
pre->fd = open(pre->source, O_RDWR | O_DIRECT);
|
|
|
|
assert_false(pre->fd < 0);
|
2023-02-09 07:00:01 +01:00
|
|
|
|
2023-05-15 14:21:37 +02:00
|
|
|
ret = fstat(pre->fd, &mode);
|
|
|
|
assert_int_equal(ret, 0);
|
|
|
|
ret = (mode.st_mode & S_IFBLK) | (mode.st_mode & S_IFMTD);
|
|
|
|
assert_true(ret != 0);
|
2023-02-09 07:00:01 +01:00
|
|
|
|
2023-05-15 14:21:37 +02:00
|
|
|
ret = ioctl(pre->fd, BIOC_GEOMETRY, (unsigned long)((uintptr_t)&pre->cfg));
|
|
|
|
assert_false(ret < 0);
|
2023-02-09 07:00:01 +01:00
|
|
|
|
|
|
|
srand((unsigned)time(&t));
|
2023-05-15 14:21:37 +02:00
|
|
|
*state = pre;
|
2023-02-09 07:00:01 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-06-07 09:14:53 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: setup_driver
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static int setup_driver(FAR void **state)
|
|
|
|
{
|
|
|
|
FAR struct pre_build_s *pre = *state;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
ret = find_mtddriver(pre->source, &pre->driver);
|
|
|
|
if (ret != 0)
|
|
|
|
{
|
|
|
|
struct geometry geometry;
|
|
|
|
ret = find_blockdriver(pre->source, 0, &pre->driver);
|
|
|
|
assert_false(ret != 0);
|
|
|
|
|
|
|
|
ret = pre->driver->u.i_bops->geometry(pre->driver, &geometry);
|
|
|
|
assert_false(ret < 0);
|
|
|
|
|
|
|
|
pre->geo.blocksize = geometry.geo_sectorsize;
|
|
|
|
pre->geo.erasesize = geometry.geo_sectorsize;
|
|
|
|
pre->geo.neraseblocks = geometry.geo_nsectors;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ret = MTD_IOCTL(pre->driver->u.i_mtd, MTDIOC_GEOMETRY,
|
|
|
|
(unsigned long)&pre->geo);
|
|
|
|
assert_false(ret < 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
srand((unsigned)time(NULL));
|
|
|
|
*state = pre;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-02-09 07:00:01 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: blktest_stress
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static void blktest_stress(FAR void **state)
|
|
|
|
{
|
2023-05-15 14:21:37 +02:00
|
|
|
FAR struct pre_build_s *pre;
|
2023-06-07 09:14:53 +02:00
|
|
|
FAR void *input;
|
|
|
|
FAR void *output;
|
2023-06-05 08:07:04 +02:00
|
|
|
blkcnt_t nsectors;
|
2023-05-15 14:21:37 +02:00
|
|
|
uint32_t input_crc;
|
2023-02-09 07:00:01 +01:00
|
|
|
uint32_t output_crc;
|
2023-06-07 09:14:53 +02:00
|
|
|
blkcnt_t i;
|
2023-05-15 14:21:37 +02:00
|
|
|
int ret;
|
2023-02-09 07:00:01 +01:00
|
|
|
|
2023-06-05 08:07:04 +02:00
|
|
|
pre = *state;
|
2023-02-09 07:00:01 +01:00
|
|
|
|
2023-06-05 08:07:04 +02:00
|
|
|
input = malloc(pre->cfg.geo_sectorsize * 2);
|
2023-05-15 14:21:37 +02:00
|
|
|
assert_true(input != NULL);
|
2023-06-05 08:07:04 +02:00
|
|
|
output = input + pre->cfg.geo_sectorsize;
|
|
|
|
|
|
|
|
/* We expect the physical bad block rate on nand flash to be no more
|
|
|
|
* than 5%, we give the redundancy space at the end.
|
|
|
|
*/
|
|
|
|
|
|
|
|
nsectors = pre->cfg.geo_nsectors * SECTORS_RANGE;
|
2023-02-09 07:00:01 +01:00
|
|
|
|
2023-06-05 08:07:04 +02:00
|
|
|
/* Test process: convert the device information of the storage device into
|
|
|
|
* 'sectors' by bch, and fill each 'sector' with random characters, then
|
|
|
|
* read it out and compare whether the writing and The difference between
|
|
|
|
* write and store is verified by crc32.
|
|
|
|
* This behavior simulates the behavior of commands such as 'dd' in the
|
|
|
|
* system. The general flow is user->bch->ftl->driver
|
|
|
|
*/
|
|
|
|
|
2023-06-07 09:14:53 +02:00
|
|
|
for (i = 0; i < nsectors; i++)
|
2023-02-09 07:00:01 +01:00
|
|
|
{
|
2023-06-05 08:07:04 +02:00
|
|
|
lseek(pre->fd, i * pre->cfg.geo_sectorsize, SEEK_SET);
|
2023-02-09 07:00:01 +01:00
|
|
|
|
2023-06-07 09:14:53 +02:00
|
|
|
blktest_randcontext(pre->cfg.geo_sectorsize, input);
|
|
|
|
input_crc = crc32(input, pre->cfg.geo_sectorsize);
|
2023-05-15 14:21:37 +02:00
|
|
|
ret = write(pre->fd, input, pre->cfg.geo_sectorsize);
|
|
|
|
assert_true(ret == pre->cfg.geo_sectorsize);
|
2023-06-05 08:07:04 +02:00
|
|
|
|
2023-05-15 14:21:37 +02:00
|
|
|
fsync(pre->fd);
|
2023-02-09 07:00:01 +01:00
|
|
|
|
2023-06-05 08:07:04 +02:00
|
|
|
/* Let's write each time we need to move the pointer back to the
|
|
|
|
* beginning
|
|
|
|
*/
|
|
|
|
|
2023-05-15 14:21:37 +02:00
|
|
|
lseek(pre->fd, i * pre->cfg.geo_sectorsize, SEEK_SET);
|
2023-02-09 07:00:01 +01:00
|
|
|
|
2023-05-15 14:21:37 +02:00
|
|
|
ret = read(pre->fd, output, pre->cfg.geo_sectorsize);
|
|
|
|
assert_int_equal(ret, pre->cfg.geo_sectorsize);
|
2023-06-07 09:14:53 +02:00
|
|
|
output_crc = crc32(output, pre->cfg.geo_sectorsize);
|
2023-05-15 14:21:37 +02:00
|
|
|
assert_false(output_crc != input_crc);
|
2023-02-09 07:00:01 +01:00
|
|
|
}
|
|
|
|
|
2023-05-15 14:21:37 +02:00
|
|
|
free(input);
|
2023-02-09 07:00:01 +01:00
|
|
|
}
|
|
|
|
|
2023-06-07 09:14:53 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: blktest_multiple_write
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static void blktest_cachesize_write(FAR void **state)
|
|
|
|
{
|
|
|
|
FAR struct pre_build_s *pre;
|
|
|
|
FAR void *input;
|
|
|
|
FAR void *output;
|
|
|
|
uint32_t input_crc;
|
|
|
|
uint32_t output_crc;
|
|
|
|
uint32_t size;
|
|
|
|
unsigned int block;
|
|
|
|
size_t i;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
pre = *state;
|
|
|
|
|
|
|
|
/* There is a possibility that the cache size (default 0) is not
|
|
|
|
* available when the case is not opened, so the case should be checked
|
|
|
|
* to see if the corresponding cache config is open.
|
|
|
|
*/
|
|
|
|
|
|
|
|
size = up_get_dcache_size();
|
|
|
|
|
|
|
|
if (size > pre->geo.blocksize && (size % pre->geo.blocksize) == 0)
|
|
|
|
{
|
|
|
|
block = (pre->geo.blocksize + size) / pre->geo.blocksize - 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
block = (pre->geo.blocksize + size) / pre->geo.blocksize;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* When we can't get the cachesize, we execute it again as
|
|
|
|
* blktest_single_write
|
|
|
|
*/
|
|
|
|
|
|
|
|
size = block * pre->geo.blocksize;
|
|
|
|
|
|
|
|
output = malloc(size);
|
|
|
|
assert_false(output == NULL);
|
|
|
|
|
|
|
|
for (i = 4; i <= 32; i *= 2)
|
|
|
|
{
|
|
|
|
/* This case is designed to simulate the behavior of a
|
|
|
|
* filesystem write. Simulate the case where the buffer constructed
|
|
|
|
* at one time may be larger than the cache size for the file system
|
|
|
|
*/
|
|
|
|
|
|
|
|
input = memalign(i, size);
|
|
|
|
assert_false(input == NULL);
|
|
|
|
blktest_randcontext(pre->geo.blocksize, input);
|
|
|
|
input_crc = crc32(input, size);
|
|
|
|
if (INODE_IS_MTD(pre->driver))
|
|
|
|
{
|
|
|
|
/* Before writing we need to erase the mtd device */
|
|
|
|
|
|
|
|
ret = MTD_ERASE(pre->driver->u.i_mtd, 0, 1);
|
|
|
|
assert_false(ret < 0);
|
|
|
|
ret = MTD_BWRITE(pre->driver->u.i_mtd, 0, block, input);
|
|
|
|
assert_false(ret != block);
|
|
|
|
ret = MTD_BREAD(pre->driver->u.i_mtd, 0, block, output);
|
|
|
|
assert_false(ret != block);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ret = pre->driver->u.i_bops->write(pre->driver, input, 0, block);
|
|
|
|
assert_false(ret < 0);
|
|
|
|
ret = pre->driver->u.i_bops->read(pre->driver, output, 0, block);
|
|
|
|
assert_false(ret < 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
output_crc = crc32(output, size);
|
|
|
|
assert_false(input_crc != output_crc);
|
|
|
|
|
|
|
|
free(input);
|
|
|
|
}
|
|
|
|
|
|
|
|
free(output);
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: blktest_single_write
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static void blktest_single_write(FAR void **state)
|
|
|
|
{
|
|
|
|
FAR struct pre_build_s *pre;
|
|
|
|
FAR void *input;
|
|
|
|
FAR void *output;
|
|
|
|
uint32_t input_crc;
|
|
|
|
uint32_t output_crc;
|
|
|
|
size_t i;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
pre = *state;
|
|
|
|
|
|
|
|
output = malloc(pre->geo.blocksize);
|
|
|
|
assert_false(output == NULL);
|
|
|
|
|
|
|
|
/* Obviously, this is just to simulate the case where the file system
|
|
|
|
* is written one eraseblock at a time
|
|
|
|
*/
|
|
|
|
|
|
|
|
for (i = 4; i <= 32; i *= 2)
|
|
|
|
{
|
|
|
|
input = memalign(i, pre->geo.blocksize);
|
|
|
|
assert_false(input == NULL);
|
|
|
|
|
|
|
|
blktest_randcontext(pre->geo.blocksize, input);
|
|
|
|
|
|
|
|
input_crc = crc32(input, pre->geo.blocksize);
|
|
|
|
|
|
|
|
if (INODE_IS_MTD(pre->driver))
|
|
|
|
{
|
|
|
|
ret = MTD_ERASE(pre->driver->u.i_mtd, 0, 1);
|
|
|
|
assert_false(ret < 0);
|
|
|
|
ret = MTD_BWRITE(pre->driver->u.i_mtd, 0, 1, input);
|
|
|
|
assert_false(ret != 1);
|
|
|
|
ret = MTD_BREAD(pre->driver->u.i_mtd, 0, 1, output);
|
|
|
|
assert_false(ret != 1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ret = pre->driver->u.i_bops->write(pre->driver, input, 0, 1);
|
|
|
|
assert_false(ret < 0);
|
|
|
|
ret = pre->driver->u.i_bops->read(pre->driver, output, 0, 1);
|
|
|
|
assert_false(ret < 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
output_crc = crc32(output, pre->geo.blocksize);
|
|
|
|
assert_false(input_crc != output_crc);
|
|
|
|
|
|
|
|
free(input);
|
|
|
|
}
|
|
|
|
|
|
|
|
free(output);
|
|
|
|
}
|
|
|
|
|
2023-02-09 07:00:01 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: teardown
|
|
|
|
****************************************************************************/
|
|
|
|
|
2023-06-07 09:14:53 +02:00
|
|
|
static int teardown_driver(FAR void **state)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: teardown_bch
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static int teardown_bch(FAR void **state)
|
2023-02-09 07:00:01 +01:00
|
|
|
{
|
2023-05-15 14:21:37 +02:00
|
|
|
FAR struct pre_build_s *pre;
|
2023-02-09 07:00:01 +01:00
|
|
|
|
2023-06-07 09:14:53 +02:00
|
|
|
pre = *state;
|
2023-02-09 07:00:01 +01:00
|
|
|
|
2023-05-15 14:21:37 +02:00
|
|
|
close(pre->fd);
|
2023-02-09 07:00:01 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: blktest_main
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
int main(int argc, FAR char *argv[])
|
|
|
|
{
|
2023-05-15 14:21:37 +02:00
|
|
|
struct pre_build_s pre;
|
2023-02-09 07:00:01 +01:00
|
|
|
|
2023-05-15 14:21:37 +02:00
|
|
|
parse_commandline(argc, argv, &pre);
|
2023-02-09 07:00:01 +01:00
|
|
|
const struct CMUnitTest tests[] =
|
|
|
|
{
|
2023-06-07 09:14:53 +02:00
|
|
|
cmocka_unit_test_prestate_setup_teardown(blktest_stress, setup_bch,
|
|
|
|
teardown_bch, &pre),
|
|
|
|
cmocka_unit_test_prestate_setup_teardown(blktest_single_write,
|
|
|
|
setup_driver, teardown_driver,
|
|
|
|
&pre),
|
|
|
|
cmocka_unit_test_prestate_setup_teardown(blktest_cachesize_write,
|
|
|
|
setup_driver, teardown_driver,
|
|
|
|
&pre),
|
2023-02-09 07:00:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
return cmocka_run_group_tests(tests, NULL, NULL);
|
|
|
|
}
|