Skip to content
Snippets Groups Projects
Commit ba8c5564 authored by Łukasz Plewa's avatar Łukasz Plewa
Browse files

test: fix pmempool check tests

As we are clearing shutdown state incompat feature by pmemspoil
we must reset SDS to 0 otherwise pmempool check will detect a pool
corruption.
parent 52f1f77a
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# Copyright 2014-2018, Intel Corporation # Copyright 2014-2019, Intel Corporation
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions # modification, are permitted provided that the following conditions
...@@ -53,6 +53,9 @@ $PMEMSPOIL -v $POOL pool_hdr.major=0x0\ ...@@ -53,6 +53,9 @@ $PMEMSPOIL -v $POOL pool_hdr.major=0x0\
pool_hdr.features.compat=0xfe\ pool_hdr.features.compat=0xfe\
pool_hdr.features.incompat=0xfb\ pool_hdr.features.incompat=0xfb\
pool_hdr.features.ro_compat=0xff\ pool_hdr.features.ro_compat=0xff\
pool_hdr.shutdown_state.usc=0\
pool_hdr.shutdown_state.uuid=0\
'pool_hdr.shutdown_state.checksum_gen()'\
pool_hdr.unused=ERROR >> $LOG pool_hdr.unused=ERROR >> $LOG
expect_normal_exit $PMEMPOOL$EXESUFFIX check -vry $POOL >> $LOG expect_normal_exit $PMEMPOOL$EXESUFFIX check -vry $POOL >> $LOG
......
# #
# Copyright 2014-2018, Intel Corporation # Copyright 2014-2019, Intel Corporation
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions # modification, are permitted provided that the following conditions
...@@ -47,11 +47,8 @@ $LOG="out$Env:UNITTEST_NUM.log" ...@@ -47,11 +47,8 @@ $LOG="out$Env:UNITTEST_NUM.log"
echo "PMEMLOG: pool_hdr" > $LOG echo "PMEMLOG: pool_hdr" > $LOG
expect_normal_exit $PMEMPOOL create log $POOL expect_normal_exit $PMEMPOOL create log $POOL
check_file $POOL check_file $POOL
# pool_hdr.features.incompat on Windows has to have SHUTDOWN_STATE feature enabled
# otherwise pmempool check will fail because of dirty shutdown state structures Invoke-Expression "$PMEMSPOIL -v $POOL pool_hdr.major=0x0 pool_hdr.features.compat=0xfe pool_hdr.features.incompat=0xfe pool_hdr.features.ro_compat=0xfb pool_hdr.shutdown_state.usc=0 pool_hdr.shutdown_state.uuid=0 'pool_hdr.shutdown_state.checksum_gen()' pool_hdr.unused=ERROR >> $LOG"
# which are expected to be zeroed if SHUTDOWN_STATE feature is disabled
# 0xfe == 0xfb | SHUTDOWN_STATE
Invoke-Expression "$PMEMSPOIL -v $POOL pool_hdr.major=0x0 pool_hdr.features.compat=0xfe pool_hdr.features.incompat=0xfe pool_hdr.features.ro_compat=0xff pool_hdr.unused=ERROR >> $LOG"
expect_normal_exit $PMEMPOOL check -vry $POOL >> $LOG expect_normal_exit $PMEMPOOL check -vry $POOL >> $LOG
echo "PMEMLOG: pmemlog" >> $LOG echo "PMEMLOG: pmemlog" >> $LOG
......
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# Copyright 2014-2018, Intel Corporation # Copyright 2014-2019, Intel Corporation
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions # modification, are permitted provided that the following conditions
...@@ -54,6 +54,9 @@ $PMEMSPOIL -v $POOL pool_hdr.major=0x0\ ...@@ -54,6 +54,9 @@ $PMEMSPOIL -v $POOL pool_hdr.major=0x0\
pool_hdr.features.compat=0xfe\ pool_hdr.features.compat=0xfe\
pool_hdr.features.incompat=0xfb\ pool_hdr.features.incompat=0xfb\
pool_hdr.features.ro_compat=0xff\ pool_hdr.features.ro_compat=0xff\
pool_hdr.shutdown_state.usc=0\
pool_hdr.shutdown_state.uuid=0\
'pool_hdr.shutdown_state.checksum_gen()'\
pool_hdr.unused=ERROR >> $LOG pool_hdr.unused=ERROR >> $LOG
expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -vyr $POOL >> $LOG expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -vyr $POOL >> $LOG
......
# #
# Copyright 2017-2018, Intel Corporation # Copyright 2017-2019, Intel Corporation
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions # modification, are permitted provided that the following conditions
...@@ -48,15 +48,14 @@ expect_normal_exit $PMEMPOOL create obj $POOL ...@@ -48,15 +48,14 @@ expect_normal_exit $PMEMPOOL create obj $POOL
expect_normal_exit $PMEMPOOL check -vyr $POOL >> $LOG expect_normal_exit $PMEMPOOL check -vyr $POOL >> $LOG
# pool_hdr.features.incompat on Windows has to have SHUTDOWN_STATE feature enabled
# otherwise pmempool check will fail because of dirty shutdown state structures
# which are expected to be zeroed if SHUTDOWN_STATE feature is disabled
# 0xfe == 0xfb | SHUTDOWN_STATE
&$PMEMSPOIL -v $POOL ` &$PMEMSPOIL -v $POOL `
pool_hdr.major=0x0 ` pool_hdr.major=0x0 `
pool_hdr.features.compat=0xfe ` pool_hdr.features.compat=0xfe `
pool_hdr.features.incompat=0xfe ` pool_hdr.features.incompat=0xfe `
pool_hdr.features.ro_compat=0xff ` pool_hdr.features.ro_compat=0xff `
pool_hdr.shutdown_state.usc=0 `
pool_hdr.shutdown_state.uuid=0 `
'pool_hdr.shutdown_state.checksum_gen()' `
pool_hdr.unused=ERROR ` pool_hdr.unused=ERROR `
>> $LOG >> $LOG
......
...@@ -3,6 +3,9 @@ $(nW): spoil: pool_hdr.major=$(*) ...@@ -3,6 +3,9 @@ $(nW): spoil: pool_hdr.major=$(*)
$(nW): spoil: pool_hdr.features.compat=$(*) $(nW): spoil: pool_hdr.features.compat=$(*)
$(nW): spoil: pool_hdr.features.incompat=$(*) $(nW): spoil: pool_hdr.features.incompat=$(*)
$(nW): spoil: pool_hdr.features.ro_compat=$(*) $(nW): spoil: pool_hdr.features.ro_compat=$(*)
$(nW): spoil: pool_hdr.shutdown_state.usc=0
$(nW): spoil: pool_hdr.shutdown_state.uuid=0
$(nW): spoil: pool_hdr.shutdown_state.checksum_gen()
$(nW): spoil: pool_hdr.unused=$(*) $(nW): spoil: pool_hdr.unused=$(*)
checking shutdown state checking shutdown state
shutdown state correct shutdown state correct
......
...@@ -8,6 +8,9 @@ $(nW)file.pool: spoil: pool_hdr.features.compat=0xfe ...@@ -8,6 +8,9 @@ $(nW)file.pool: spoil: pool_hdr.features.compat=0xfe
$(OPT)$(nW)file.pool: spoil: pool_hdr.features.incompat=0xfb $(OPT)$(nW)file.pool: spoil: pool_hdr.features.incompat=0xfb
$(OPX)$(nW)file.pool: spoil: pool_hdr.features.incompat=0xfe $(OPX)$(nW)file.pool: spoil: pool_hdr.features.incompat=0xfe
$(nW)file.pool: spoil: pool_hdr.features.ro_compat=0xff $(nW)file.pool: spoil: pool_hdr.features.ro_compat=0xff
$(nW): spoil: pool_hdr.shutdown_state.usc=0
$(nW): spoil: pool_hdr.shutdown_state.uuid=0
$(nW): spoil: pool_hdr.shutdown_state.checksum_gen()
$(nW)file.pool: spoil: pool_hdr.unused=ERROR $(nW)file.pool: spoil: pool_hdr.unused=ERROR
checking shutdown state checking shutdown state
shutdown state correct shutdown state correct
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment