diff options
Diffstat (limited to 'usr.sbin/makefs/tests/makefs_ffs_tests.sh')
-rw-r--r-- | usr.sbin/makefs/tests/makefs_ffs_tests.sh | 80 |
1 files changed, 77 insertions, 3 deletions
diff --git a/usr.sbin/makefs/tests/makefs_ffs_tests.sh b/usr.sbin/makefs/tests/makefs_ffs_tests.sh index 1a415cb5f518..f828f632b06e 100644 --- a/usr.sbin/makefs/tests/makefs_ffs_tests.sh +++ b/usr.sbin/makefs/tests/makefs_ffs_tests.sh @@ -23,9 +23,6 @@ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# $FreeBSD$ -# MAKEFS="makefs -t ffs" MOUNT="mount" @@ -244,6 +241,80 @@ o_flag_version_2_cleanup() common_cleanup } + +atf_test_case T_flag_dir cleanup +T_flag_dir_body() +{ + timestamp=1742574909 + create_test_dirs + + mkdir -p $TEST_INPUTS_DIR/dir1 + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -M 1m -T $timestamp $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + eval $(stat -s $TEST_MOUNT_DIR/dir1) + atf_check_equal $st_atime $timestamp + atf_check_equal $st_mtime $timestamp + atf_check_equal $st_ctime $timestamp +} + +T_flag_dir_cleanup() +{ + common_cleanup +} + +atf_test_case T_flag_F_flag cleanup +T_flag_F_flag_body() +{ + atf_expect_fail "-F doesn't take precedence over -T" + timestamp_F=1742574909 + timestamp_T=1742574910 + create_test_dirs + mkdir -p $TEST_INPUTS_DIR/dir1 + + atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ + mtree -c -k "type,time" -p $TEST_INPUTS_DIR + change_mtree_timestamp $TEST_SPEC_FILE $timestamp_F + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -F $TEST_SPEC_FILE -T $timestamp_T -M 1m $TEST_IMAGE $TEST_INPUTS_DIR + + mount_image + eval $(stat -s $TEST_MOUNT_DIR/dir1) + atf_check_equal $st_atime $timestamp_F + atf_check_equal $st_mtime $timestamp_F + atf_check_equal $st_ctime $timestamp_F +} + +T_flag_F_flag_cleanup() +{ + common_cleanup +} + +atf_test_case T_flag_mtree cleanup +T_flag_mtree_body() +{ + timestamp=1742574909 + create_test_dirs + mkdir -p $TEST_INPUTS_DIR/dir1 + + atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ + mtree -c -k "type" -p $TEST_INPUTS_DIR + atf_check -e empty -o not-empty -s exit:0 \ + $MAKEFS -M 1m -T $timestamp $TEST_IMAGE $TEST_SPEC_FILE + + mount_image + eval $(stat -s $TEST_MOUNT_DIR/dir1) + atf_check_equal $st_atime $timestamp + atf_check_equal $st_mtime $timestamp + atf_check_equal $st_ctime $timestamp +} + +T_flag_mtree_cleanup() +{ + common_cleanup +} + atf_init_test_cases() { @@ -258,4 +329,7 @@ atf_init_test_cases() atf_add_test_case o_flag_version_1 atf_add_test_case o_flag_version_2 + atf_add_test_case T_flag_dir + atf_add_test_case T_flag_F_flag + atf_add_test_case T_flag_mtree } |