Add some more test blobs

This commit is contained in:
Paul Reeves 2023-02-03 15:03:05 +01:00
parent bb1fdf8833
commit 91b8a98ee3
2 changed files with 40 additions and 6 deletions

View File

@ -13,12 +13,37 @@ set bail on;
commit;
/*
* TODO dynamically generate these file names and descriptions depending upon OS platform.
* It would be nice to dynamically generate these file names and descriptions depending upon OS platform.
* This requires some shell trickery.
*/
-- A text file smaller than max blob segment size
insert into test_blobs( description, file_type, source_file ) values ('fb config', 'txt', '/opt/firebird/firebird.conf');
-- A text file that _may_ be larger than max blob segment size
insert into test_blobs( description, file_type, source_file ) values ('fb log', 'txt', '/opt/firebird/firebird.log');
insert into test_blobs( description, file_type, source_file ) values ('computer', 'bin', '/usr/share/icons/Adwaita/48x48/devices/computer.png');
insert into test_blobs( description, file_type, source_file ) values ('git gui icon', 'bin', '/usr/share/git-gui/lib/git-gui.ico');
-- a binary file smaller than max blob segment size
insert into test_blobs( description, file_type, source_file ) values ('timezoneTypes', 'bin', '/opt/firebird/tzdata/timezoneTypes.res');
-- a binary file larger than max blob segment size
insert into test_blobs( description, file_type, source_file ) values ('zoneinfo64.res', 'bin', '/opt/firebird/tzdata/zoneinfo64.res');
-- a binary file smaller than max blob segment size
insert into test_blobs( description, file_type, source_file ) values ('ib_util lib', 'bin', '/opt/firebird/lib/libib_util.so');
-- a binary file larger than max blob segment size - may need to set write perm if this fails
insert into test_blobs( description, file_type, source_file ) values ('udr plugin engine', 'bin', '/opt/firebird/plugins/libudr_engine.so');
-- A text file that is larger than max blob segment size (on Firebird 4.0) May not exist in all installs
--insert into test_blobs( description, file_type, source_file ) values ('fb changelog', 'txt', '/opt/firebird/CHANGELOG.md');
/*
* Untested but this should be the windows equivalent - Note that the tests in testudrkit-tests.dml would need to be changed too!
insert into test_blobs( description, file_type, source_file ) values ('fb config', 'txt', 'C:\\Program Files\\Firebird\\Firebird_4_0\\firebird.conf');
insert into test_blobs( description, file_type, source_file ) values ('fb log', 'txt', 'C:\\Program Files\\Firebird\\Firebird_4_0\\firebird.log');
*/
commit;

View File

@ -18,9 +18,12 @@ execute procedure load_blob(1);
execute procedure load_blob(2);
execute procedure load_blob(3);
execute procedure load_blob(4);
execute procedure load_blob(5);
execute procedure load_blob(6);
commit;
select cast ( description as varchar(16) ) as DESCRIPTION
-- Note that we truncate the output here to fit the console better
select cast ( left(description,16) as varchar(16) ) as DESCRIPTION
, file_type
, cast (left(source_file,32) as varchar(32)) as source_file
, source_status
@ -32,16 +35,22 @@ commit;
set term ^;
shell
mkdir --verbose /tmp/testudrkit
if [[ ! -d /tmp/testudrkit ]]; then
mkdir --verbose /tmp/testudrkit
fi
ls /tmp/testudrkit
^
set term ;^
execute procedure save_blob(1, '/tmp/testudrkit/fb.conf' );
execute procedure save_blob(2, '/tmp/testudrkit/fb.log' );
execute procedure save_blob(3, '/tmp/testudrkit/timezoneTypes.res' );
execute procedure save_blob(4, '/tmp/testudrkit/zoneinfo64.res' );
execute procedure save_blob(5, '/tmp/testudrkit/libib_util.so' );
execute procedure save_blob(6, '/tmp/testudrkit/libudr_engine.so' );
commit;
select cast ( description as varchar(16) ) as DESCRIPTION
select cast ( left(description,16) as varchar(16) ) as DESCRIPTION
, file_type
, cast (left(source_file,32) as varchar(32)) as source_file
, source_status