Renamed all prefixes to include the major version

This is needed to allow compilation of multiple versions in the same
binary. Also note that the FUSE testing was removed because of related
name issues.

./scripts/prefix.py lfs2
This commit is contained in:
Christopher Haster
2019-01-30 14:00:35 -06:00
parent 95c1a6339d
commit 97e21eb68e
27 changed files with 5573 additions and 5606 deletions

View File

@@ -6,71 +6,71 @@ echo "=== Corrupt tests ==="
NAMEMULT=64
FILEMULT=1
lfs_mktree() {
lfs2_mktree() {
tests/test.py ${1:-} << TEST
lfs_format(&lfs, &cfg) => 0;
lfs2_format(&lfs2, &cfg) => 0;
lfs_mount(&lfs, &cfg) => 0;
lfs2_mount(&lfs2, &cfg) => 0;
for (int i = 1; i < 10; i++) {
for (int j = 0; j < $NAMEMULT; j++) {
buffer[j] = '0'+i;
}
buffer[$NAMEMULT] = '\0';
lfs_mkdir(&lfs, (char*)buffer) => 0;
lfs2_mkdir(&lfs2, (char*)buffer) => 0;
buffer[$NAMEMULT] = '/';
for (int j = 0; j < $NAMEMULT; j++) {
buffer[j+$NAMEMULT+1] = '0'+i;
}
buffer[2*$NAMEMULT+1] = '\0';
lfs_file_open(&lfs, &file[0], (char*)buffer,
LFS_O_WRONLY | LFS_O_CREAT) => 0;
lfs2_file_open(&lfs2, &file[0], (char*)buffer,
LFS2_O_WRONLY | LFS2_O_CREAT) => 0;
size = $NAMEMULT;
for (int j = 0; j < i*$FILEMULT; j++) {
lfs_file_write(&lfs, &file[0], buffer, size) => size;
lfs2_file_write(&lfs2, &file[0], buffer, size) => size;
}
lfs_file_close(&lfs, &file[0]) => 0;
lfs2_file_close(&lfs2, &file[0]) => 0;
}
lfs_unmount(&lfs) => 0;
lfs2_unmount(&lfs2) => 0;
TEST
}
lfs_chktree() {
lfs2_chktree() {
tests/test.py ${1:-} << TEST
lfs_mount(&lfs, &cfg) => 0;
lfs2_mount(&lfs2, &cfg) => 0;
for (int i = 1; i < 10; i++) {
for (int j = 0; j < $NAMEMULT; j++) {
buffer[j] = '0'+i;
}
buffer[$NAMEMULT] = '\0';
lfs_stat(&lfs, (char*)buffer, &info) => 0;
info.type => LFS_TYPE_DIR;
lfs2_stat(&lfs2, (char*)buffer, &info) => 0;
info.type => LFS2_TYPE_DIR;
buffer[$NAMEMULT] = '/';
for (int j = 0; j < $NAMEMULT; j++) {
buffer[j+$NAMEMULT+1] = '0'+i;
}
buffer[2*$NAMEMULT+1] = '\0';
lfs_file_open(&lfs, &file[0], (char*)buffer, LFS_O_RDONLY) => 0;
lfs2_file_open(&lfs2, &file[0], (char*)buffer, LFS2_O_RDONLY) => 0;
size = $NAMEMULT;
for (int j = 0; j < i*$FILEMULT; j++) {
lfs_file_read(&lfs, &file[0], rbuffer, size) => size;
lfs2_file_read(&lfs2, &file[0], rbuffer, size) => size;
memcmp(buffer, rbuffer, size) => 0;
}
lfs_file_close(&lfs, &file[0]) => 0;
lfs2_file_close(&lfs2, &file[0]) => 0;
}
lfs_unmount(&lfs) => 0;
lfs2_unmount(&lfs2) => 0;
TEST
}
echo "--- Sanity check ---"
rm -rf blocks
lfs_mktree
lfs_chktree
lfs2_mktree
lfs2_chktree
BLOCKS="$(ls blocks | grep -vw '[01]')"
echo "--- Block corruption ---"
@@ -79,8 +79,8 @@ do
rm -rf blocks
mkdir blocks
ln -s /dev/zero blocks/$b
lfs_mktree
lfs_chktree
lfs2_mktree
lfs2_chktree
done
echo "--- Block persistance ---"
@@ -88,10 +88,10 @@ for b in $BLOCKS
do
rm -rf blocks
mkdir blocks
lfs_mktree
lfs2_mktree
chmod a-w blocks/$b || true
lfs_mktree
lfs_chktree
lfs2_mktree
lfs2_chktree
done
echo "--- Big region corruption ---"
@@ -101,8 +101,8 @@ for i in {2..512}
do
ln -s /dev/zero blocks/$(printf '%x' $i)
done
lfs_mktree
lfs_chktree
lfs2_mktree
lfs2_chktree
echo "--- Alternating corruption ---"
rm -rf blocks
@@ -111,8 +111,8 @@ for i in {2..1024..2}
do
ln -s /dev/zero blocks/$(printf '%x' $i)
done
lfs_mktree
lfs_chktree
lfs2_mktree
lfs2_chktree
echo "--- Results ---"
tests/stats.py