Index: openacs-4/packages/oacs-dav/tcl/test/oacs-dav-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/oacs-dav/tcl/test/oacs-dav-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/oacs-dav/tcl/test/oacs-dav-procs.tcl 7 Aug 2017 23:48:13 -0000 1.4 +++ openacs-4/packages/oacs-dav/tcl/test/oacs-dav-procs.tcl 9 Jul 2018 12:03:33 -0000 1.5 @@ -49,7 +49,9 @@ # we probably want to create a bunch of files in the filesystem # and test mime type and other attributes to make sure the # content gets in the database - set fd [open [oacs_dav::conn tmpfile] r] + set tmpfile [oacs_dav::conn tmpfile] + set tmpfilesize [file size $tmpfile] + set fd [open $tmpfile r] set orig_content [read $fd] close $fd set folder_id [db_exec_plsql create_test_folder ""] @@ -58,14 +60,19 @@ db_exec_plsql register_content_type "" oacs_dav::register_folder $folder_id $sn(node_id) set response [oacs_dav::impl::content_revision::put] + ## Rewrite the file, as put operation would destroy it + set fd [open $tmpfile w] + puts -nonewline $fd $orig_content + close $fd + ## aa_log "Response was $response" set new_item_id [db_string item_exists "" -default ""] aa_log "Item_id=$new_item_id" aa_true "Content Item Created" [expr {$new_item_id ne ""}] set revision_id [db_string revision_exists "" -default ""] aa_true "Content Revision Created" [expr {$revision_id ne ""}] set cr_filename "[cr_fs_path]/[db_string get_content_filename ""]" - aa_true "Content Attribute Set" [string equal [file size [oacs_dav::conn tmpfile]] [file size $cr_filename]] + aa_true "Content Attribute Set" {$tmpfilesize == [file size $cr_filename]} }