summaryrefslogtreecommitdiff
path: root/tests/test-sizes.js
Commit message (Collapse)AuthorAgeFilesLines
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* lib/commit: Include object type in sizes metadataJohn Hiesey2020-01-201-23/+41
| | | | | | | | | | | | | | | | Append a byte encoding the OSTree object type for each object in the metadata. This allows the commit metadata to be fetched and then for the program to see which objects it already has for an accurate calculation of which objects need to be downloaded. This slightly breaks the `ostree.sizes` `ay` metadata entries. However, it's unlikely anyone was asserting the length of the entries since the array currently ends in 2 variable length integers. As far as I know, the only users of the sizes metadata are the ostree test suite and Endless' eos-updater[1]. The former is updated here and the latter already expects this format. 1. https://github.com/endlessm/eos-updater/
* tests/sizes: Check duplicate file doesn't add sizes entryDan Nicholson2020-01-201-1/+11
| | | | | A duplicate file will resolve to the same object, so it shouldn't add any entries to the sizes metadata.
* tests/sizes: Test that sizes metadata is not reusedDan Nicholson2020-01-201-1/+18
| | | | | Ensure that the object sizes hash table is cleared after a commit and not only when the repo is closed.
* tests/sizes: Test sizes metadata with existing objectsDan Nicholson2020-01-201-1/+15
| | | | | Repeat the commit to make sure that the files are enumerated again for the size metadata.
* tests/sizes: Improve metadata validationDan Nicholson2020-01-201-27/+99
| | | | | | | | | Ensure all 3 of the checksum, compressed size and uncompressed size are correct. For repeatable objects, skip xattrs and use canonical permissions for the commit. For the sizes, read a varint rather than assuming they will be a single byte. To work around bugs in gjs with byte array unpacking, manually build the array byte by byte. Split out some helper functions to use in subsequent tests.
* tests/sizes.js: Fix byte array unpackingDan Nicholson2019-07-231-4/+4
| | | | | | | | | | | | | | | | Recent GJS changed how byte arrays are unpacked with some assumptions that they are likely strings. Manually use get_child_value() and get_byte() to ensure the correct value is parsed when checking the `ostree.sizes` metadata. The upstream test is currently passing fine with GJS 1.56.2, but at Endless we (unfortunately) have a downstream change that adds the object type as an additional byte in the array. This is parsed incorrectly by `deep_unpack()`. We can carry this patch downstream, but this change makes the test more robust regardless. Closes: #1884 Approved by: cgwalters
* tests/sizes: Fix call to commit_transaction()Dan Nicholson2019-07-231-1/+1
| | | | | | | | | | | | | The GIR for commit_transaction() only has a single argument for the GCancellable. Calling it with 2 arguments prints a GJS warning: Gjs-Message: 15:37:40.287: JS WARNING: [/home/dan/src/ostree/tests/test-sizes.js 56]: Too many arguments to method OSTree.Repo.commit_transaction: expected 1, got 2 Currently this is harmless, but it could become a hard error in GJS at some point. Closes: #1884 Approved by: cgwalters
* Add SPDX-License-Identifier to source filesMarcus Folkesson2018-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | SPDX License List is a list of (common) open source licenses that can be referred to by a “short identifier”. It has several advantages compared to the common "license header texts" usually found in source files. Some of the advantages: * It is precise; there is no ambiguity due to variations in license header text * It is language neutral * It is easy to machine process * It is concise * It is simple and can be used without much cost in interpreted environments like java Script, etc. * An SPDX license identifier is immutable. * It provides simple guidance for developers who want to make sure the license for their code is respected See http://spdx.org for further reading. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Closes: #1439 Approved by: cgwalters
* tests: More fixes for gjs testsColin Walters2017-07-211-1/+3
| | | | | | | | | | | | | | | | | Previous to this commit, the gjs tests were installed-only; and our logic for handling the "--enable-installed-tests=exclusive" logic actually also meant they weren't installed. It did work for me locally with `--enable-installed-tests`. However, to make things fully symmetric, let's enable the js tests to also be run under `make check`. Also remove `corrupt-repo-ref.js` from the PAPR invocation since it's not actually a unit test, it's a utility helper. Closes: #1022 Approved by: jlebon
* core: Add size information to commit metadataJeremy Whiting2013-10-191-0/+82
Add a --generate-sizes option to commit to add size information to the commit metadata. This will be used by higher level code which wants to determine the total size necessary for downloading.