Commit fd0d3801 authored by Pavel Emelyanov's avatar Pavel Emelyanov

zdtm: Test HUGE mappings to dump/restore OK

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent cf01381c
......@@ -11,6 +11,7 @@ static/env00
static/maps00
static/maps01
static/maps02
static/maps04
static/mprotect00
static/mtime_mmap
static/sleeping00
......
......@@ -61,6 +61,7 @@ TST_NOFILE = \
maps01 \
maps02 \
maps03 \
maps04 \
xids00 \
groups \
file_fown \
......
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <linux/limits.h>
#include "zdtmtst.h"
#define PAGE_SIZE 4096
#define MEM_SIZE (1L << 29)
const char *test_doc = "Test big mappings";
const char *test_author = "Andrew Vagin <avagin@openvz.org";
int main(int argc, char ** argv)
{
void *m;
uint32_t crc;
test_init(argc, argv);
m = mmap(NULL, MEM_SIZE, PROT_WRITE | PROT_READ,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (m == MAP_FAILED) {
fail();
return 1;
}
crc = ~0;
datagen(m, MEM_SIZE, &crc);
test_daemon();
test_waitsig();
crc = ~0;
if (datachk(m, MEM_SIZE, &crc))
fail("Mem corrupted");
else
pass();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment