diff --git a/test/cli/file.js b/test/cli/file.js index afe4d98db0..e4a5e0c9ce 100644 --- a/test/cli/file.js +++ b/test/cli/file.js @@ -4,7 +4,7 @@ const expect = require('chai').expect const runOnAndOff = require('../utils/on-and-off') const file = 'QmR56UJmAaZLXLdTT1ALrE9vVqV8soUEekm9BMd4FnuYqV' -const dir = 'QmYmW4HiZhotsoSqnv2o1oUusvkRM8b9RweBoH7ao5nki2' +const dir = 'Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z' describe('file ls', () => runOnAndOff((thing) => { let ipfs @@ -12,7 +12,7 @@ describe('file ls', () => runOnAndOff((thing) => { before(function () { this.timeout(50 * 1000) ipfs = thing.ipfs - return ipfs('files add -r test/fixtures/test-data/recursive-get-dir') + return ipfs('add -r test/fixtures/test-data/recursive-get-dir') }) it('prints a filename', () => { @@ -27,9 +27,9 @@ describe('file ls', () => runOnAndOff((thing) => { return ipfs(`file ls ${dir}`) .then((out) => expect(out).to.eql( `This functionality is deprecated, and will be removed in future versions. If possible, please use 'ipfs ls' instead.\n` + - 'QmQQHYDwAQms78fPcvx1uFFsfho23YJNoewfLbi9AtdyJ9\n' + + 'QmamKEPmEH9RUsqRQsfNf5evZQDQPYL9KXg1ADeT7mkHkT\n' + 'QmPkWYfSLCEBLZu7BZt4kigGDMe3cpogMbeVf97gN2xJDN\n' + - 'Qma13ZrhKG52MWnwtZ6fMD8jGj8d4Q9sJgn5xtKgeZw5uz\n' + + 'QmUqyZtPmsRy1U5Mo8kz2BAMmk1hfJ7yW1KAFTMB2odsFv\n' + 'QmUhUuiTKkkK8J6JZ9zmj8iNHPuNfGYcszgRumzhHBxEEU\n' + 'QmR56UJmAaZLXLdTT1ALrE9vVqV8soUEekm9BMd4FnuYqV\n' )) diff --git a/test/cli/files.js b/test/cli/files.js index 07b5421aa7..6dd19614e3 100644 --- a/test/cli/files.js +++ b/test/cli/files.js @@ -44,12 +44,12 @@ describe('files', () => runOnAndOff((thing) => { 'added QmeiTxVN4xAjxUzHzBqCpK3GaT3GeiLQeJRpYDXDfLeEmR recursive-get-dir/datastore/MANIFEST-000014', 'added QmQpc75sJGUv59dAwHF7vazBGV9o6C7z587Dp9nv7HYAps recursive-get-dir/datastore/LOG.old', 'added QmbFNLNr9at9eK5LrNyUdyE5cdLb5yaT9DkjXw7BK68kcM recursive-get-dir/datastore/LOG', - 'added QmfJMCvenrj4SKKRc48DYPxwVdS44qCUCqqtbqhJuSTWXP recursive-get-dir/datastore/LOCK', + 'added QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH recursive-get-dir/datastore/LOCK', 'added QmVJi93Yj5RW3NuqqxonGz3jAXUYHrdQvWrURxg1TiLEuX recursive-get-dir/datastore/CURRENT', 'added QmcJ6TXPMPm6puSC9vpxuG57PyfGpr8bvTgkKU9SHHU5Uo recursive-get-dir/datastore/000010.ldb', 'added QmPFVLPmp9zv5Z5KUqLhe2EivAGccQW2r7M7jhVJGLZoZU recursive-get-dir/datastore/000005.ldb', 'added QmfExFwdFKspsY2q5WnhQjd1QDKnjpTQ4UkiHqqQxV7h67 recursive-get-dir/datastore/000002.ldb', - 'added Qma13ZrhKG52MWnwtZ6fMD8jGj8d4Q9sJgn5xtKgeZw5uz recursive-get-dir/datastore', + 'added QmUqyZtPmsRy1U5Mo8kz2BAMmk1hfJ7yW1KAFTMB2odsFv recursive-get-dir/datastore', 'added QmPkWYfSLCEBLZu7BZt4kigGDMe3cpogMbeVf97gN2xJDN recursive-get-dir/config', 'added QmbJgQa4XNBFvGQcLbWBNtvWZetbCUKiyAQNfePoTzwf9L recursive-get-dir/blocks/CIQPD/CIQPDQJBGYDZNMOAGGYNRNMP2VDKWBWGAEDDEJDACM3SGG3VIANDDXI.data', 'added QmSCUPYy4CfFt9nA61J9v2DMfJygQAJjaUcRmygDbVME2D recursive-get-dir/blocks/CIQPD', @@ -61,8 +61,8 @@ describe('files', () => runOnAndOff((thing) => { 'added Qmec4atiyfysPR8HU5gPfjKY1NpQDY2kmSeeadx8wLEBqY recursive-get-dir/blocks/CIQOM', 'added QmeBypQ2yE4t4Loybhby15DjkeLDXJKCcgMfxTXeFnHa8F recursive-get-dir/blocks/CIQOL/CIQOLBQZSZAODJGGH6RYYVBUXHTS3SM5EORZDU63LYPEFUAFE4SBM4I.data', 'added Qmd6s8LXAEjW7y9QbGSzeuewrRBYjJHmcazG3Hk7cJ74da recursive-get-dir/blocks/CIQOL', - 'added QmfJMCvenrj4SKKRc48DYPxwVdS44qCUCqqtbqhJuSTWXP recursive-get-dir/blocks/CIQOH/CIQOHMGEIKMPYHAUTL57JSEZN64SIJ5OIHSGJG4TJSSJLGI3PBJLQVI.data', - 'added QmdiJnDhn4Bb1odByw1BA5qpXssjxgttVz42tpEfo7HNUe recursive-get-dir/blocks/CIQOH', + 'added QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH recursive-get-dir/blocks/CIQOH/CIQOHMGEIKMPYHAUTL57JSEZN64SIJ5OIHSGJG4TJSSJLGI3PBJLQVI.data', + 'added QmTnaav9VTSVyLu8PvRzh4gJ8heF9rpdWzeDb7rMx5DkxV recursive-get-dir/blocks/CIQOH', 'added Qmc1nasezDdPyZiXB5VB6Aygzswcr6QkauzzXMeUGouHTN recursive-get-dir/blocks/CIQMB/CIQMB7DLJFKD267QJ2B5FJNHZPTSVA7IB6OHXSQ2XSVEEKMKK6RT75I.data', 'added QmeqJBkwmzsVR79HBKLW7AYhfAMxMaJs5dGHSgey5ezy7N recursive-get-dir/blocks/CIQMB', 'added QmaSjzSSRanYzRGPXQY6m5SWfSkkfcnzNkurJEQc4chPJx recursive-get-dir/blocks/CIQLB/CIQLBS5HG4PRCRQ7O4EBXFD5QN6MTI5YBYMCVQJDXPKCOVR6RMLHZFQ.data', @@ -113,8 +113,8 @@ describe('files', () => runOnAndOff((thing) => { 'added QmSCq2peGvGDXZKuX565UczxRpgzsiPPF3PgcJq9zDbByL recursive-get-dir/blocks/CIQDD', 'added QmdgaiKe1HFfhrZvLwTFCrXmgTojhSWuBvyFXUVc8KzJVc recursive-get-dir/blocks/CIQBE/CIQBED3K6YA5I3QQWLJOCHWXDRK5EXZQILBCKAPEDUJENZ5B5HJ5R3A.data', 'added QmYwUkwNwJN2cevwXKL48DRpbbjbdLWyyLANG3BKTtsTZ8 recursive-get-dir/blocks/CIQBE', - 'added QmQQHYDwAQms78fPcvx1uFFsfho23YJNoewfLbi9AtdyJ9 recursive-get-dir/blocks', - 'added QmYmW4HiZhotsoSqnv2o1oUusvkRM8b9RweBoH7ao5nki2 recursive-get-dir' + 'added QmamKEPmEH9RUsqRQsfNf5evZQDQPYL9KXg1ADeT7mkHkT recursive-get-dir/blocks', + 'added Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z recursive-get-dir' ] before(() => { @@ -124,7 +124,7 @@ describe('files', () => runOnAndOff((thing) => { it('add with progress', function () { this.timeout(30 * 1000) - return ipfs('files add -p src/init-files/init-docs/readme') + return ipfs('add -p src/init-files/init-docs/readme') .then((out) => { expect(out) .to.eql('added QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB readme\n') @@ -134,7 +134,7 @@ describe('files', () => runOnAndOff((thing) => { it('add', function () { this.timeout(30 * 1000) - return ipfs('files add src/init-files/init-docs/readme') + return ipfs('add src/init-files/init-docs/readme') .then((out) => { expect(out) .to.eql('added QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB readme\n') @@ -154,7 +154,7 @@ describe('files', () => runOnAndOff((thing) => { it('add recursively test', function () { this.timeout(60 * 1000) - return ipfs('files add -r test/fixtures/test-data/recursive-get-dir') + return ipfs('add -r test/fixtures/test-data/recursive-get-dir') .then((out) => { expect(out).to.eql(recursiveGetDirResults.join('\n') + '\n') }) @@ -163,7 +163,7 @@ describe('files', () => runOnAndOff((thing) => { it('add directory with trailing slash test', function () { this.timeout(30 * 1000) - return ipfs('files add -r test/fixtures/test-data/recursive-get-dir/') + return ipfs('add -r test/fixtures/test-data/recursive-get-dir/') .then((out) => { expect(out).to.eql(recursiveGetDirResults.join('\n') + '\n') }) @@ -177,7 +177,7 @@ describe('files', () => runOnAndOff((thing) => { 'added QmXJGoo27bg7ExNAtr9vRcivxDwcfHtkxatGno9HrUdR16 odd-name-[v0]' ] - return ipfs('files add -r test/fixtures/odd-name-[v0]') + return ipfs('add -r test/fixtures/odd-name-[v0]') .then((out) => { expect(out).to.eql(expected.join('\n') + '\n') }) @@ -258,7 +258,7 @@ describe('files', () => runOnAndOff((thing) => { it('add --quiet', function () { this.timeout(30 * 1000) - return ipfs('files add -q src/init-files/init-docs/readme') + return ipfs('add -q src/init-files/init-docs/readme') .then((out) => { expect(out) .to.eql('added QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB\n') @@ -268,7 +268,7 @@ describe('files', () => runOnAndOff((thing) => { it('add --quieter', function () { this.timeout(30 * 1000) - return ipfs('files add -Q -w test/fixtures/test-data/hello test/test-data/node.json') + return ipfs('add -Q -w test/fixtures/test-data/hello test/test-data/node.json') .then((out) => { expect(out) .to.eql('QmYRMUVULBfj7WrdPESnwnyZmtayN6Sdrwh1nKcQ9QgQeZ\n') @@ -278,7 +278,7 @@ describe('files', () => runOnAndOff((thing) => { it('add --silent', function () { this.timeout(30 * 1000) - return ipfs('files add --silent src/init-files/init-docs/readme') + return ipfs('add --silent src/init-files/init-docs/readme') .then((out) => { expect(out) .to.eql('') @@ -286,7 +286,7 @@ describe('files', () => runOnAndOff((thing) => { }) it('add --only-hash outputs correct hash', function () { - return ipfs('files add --only-hash src/init-files/init-docs/readme') + return ipfs('add --only-hash src/init-files/init-docs/readme') .then(out => expect(out) .to.eql('added QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB readme\n') @@ -330,7 +330,7 @@ describe('files', () => runOnAndOff((thing) => { it('cat', function () { this.timeout(30 * 1000) - return ipfs('files cat QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB') + return ipfs('cat QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB') .then((out) => { expect(out).to.eql(readme) }) @@ -348,7 +348,7 @@ describe('files', () => runOnAndOff((thing) => { it('cat part of a file using `count`', function () { this.timeout(30 * 1000) - return ipfs('files cat QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB --offset 21 --count 5') + return ipfs('cat QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB --offset 21 --count 5') .then((out) => { expect(out).to.eql(readme.substring(21, 26)) }) @@ -357,7 +357,7 @@ describe('files', () => runOnAndOff((thing) => { it('cat part of a file using `length`', function () { this.timeout(30 * 1000) - return ipfs('files cat QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB --offset 21 --length 5') + return ipfs('cat QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB --offset 21 --length 5') .then((out) => { expect(out).to.eql(readme.substring(21, 26)) }) @@ -374,7 +374,7 @@ describe('files', () => runOnAndOff((thing) => { it('get', function () { this.timeout(20 * 1000) - return ipfs('files get QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB') + return ipfs('get QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB') .then((out) => { expect(out) .to.eql('Saving file(s) QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB\n') @@ -406,16 +406,16 @@ describe('files', () => runOnAndOff((thing) => { it('get recursively', function () { this.timeout(20 * 1000) - const outDir = path.join(process.cwd(), 'QmYmW4HiZhotsoSqnv2o1oUusvkRM8b9RweBoH7ao5nki2') + const outDir = path.join(process.cwd(), 'Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z') rimraf(outDir) - return ipfs('files get QmYmW4HiZhotsoSqnv2o1oUusvkRM8b9RweBoH7ao5nki2') + return ipfs('get Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z') .then((out) => { expect(out).to.eql( - 'Saving file(s) QmYmW4HiZhotsoSqnv2o1oUusvkRM8b9RweBoH7ao5nki2\n' + 'Saving file(s) Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z\n' ) - const outDir = path.join(process.cwd(), 'QmYmW4HiZhotsoSqnv2o1oUusvkRM8b9RweBoH7ao5nki2') + const outDir = path.join(process.cwd(), 'Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z') const expectedDir = path.join(process.cwd(), 'test', 'fixtures', 'test-data', 'recursive-get-dir') const compareResult = compareDir(outDir, expectedDir, { diff --git a/test/cli/init.js b/test/cli/init.js index 86e0dbacda..b1a826c1db 100644 --- a/test/cli/init.js +++ b/test/cli/init.js @@ -42,7 +42,7 @@ describe('init', function () { // Test that the following was written when init-ing the repo // jsipfs files cat /ipfs/QmfGBRT6BbWJd7yUc2uYdaUZJBbnEFvTqehPFoSMQ6wgdr/readme - let command = out.substring(out.indexOf('files cat'), out.length - 2 /* omit the newline char */) + let command = out.substring(out.indexOf('cat'), out.length - 2 /* omit the newline char */) return ipfs(command) }).then((out) => expect(out).to.equal(readme)) }) diff --git a/test/cli/ls.js b/test/cli/ls.js index 68acb5bcf3..4eccf82c07 100644 --- a/test/cli/ls.js +++ b/test/cli/ls.js @@ -9,17 +9,17 @@ describe('ls', () => runOnAndOff((thing) => { before(() => { ipfs = thing.ipfs - return ipfs('files add -r test/fixtures/test-data/recursive-get-dir') + return ipfs('add -r test/fixtures/test-data/recursive-get-dir') }) it('prints added files', function () { this.timeout(20 * 1000) - return ipfs('ls QmYmW4HiZhotsoSqnv2o1oUusvkRM8b9RweBoH7ao5nki2') + return ipfs('ls Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z') .then((out) => { expect(out).to.eql( - 'QmQQHYDwAQms78fPcvx1uFFsfho23YJNoewfLbi9AtdyJ9 123530 blocks/\n' + + 'QmamKEPmEH9RUsqRQsfNf5evZQDQPYL9KXg1ADeT7mkHkT 123530 blocks/\n' + 'QmPkWYfSLCEBLZu7BZt4kigGDMe3cpogMbeVf97gN2xJDN 3939 config\n' + - 'Qma13ZrhKG52MWnwtZ6fMD8jGj8d4Q9sJgn5xtKgeZw5uz 5503 datastore/\n' + + 'QmUqyZtPmsRy1U5Mo8kz2BAMmk1hfJ7yW1KAFTMB2odsFv 5503 datastore/\n' + 'QmUhUuiTKkkK8J6JZ9zmj8iNHPuNfGYcszgRumzhHBxEEU 7397 init-docs/\n' + 'QmR56UJmAaZLXLdTT1ALrE9vVqV8soUEekm9BMd4FnuYqV 10 version\n' ) @@ -38,13 +38,13 @@ describe('ls', () => runOnAndOff((thing) => { it('adds a header, -v', function () { this.timeout(20 * 1000) - return ipfs('ls /ipfs/QmYmW4HiZhotsoSqnv2o1oUusvkRM8b9RweBoH7ao5nki2 -v') + return ipfs('ls /ipfs/Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z -v') .then((out) => { expect(out).to.eql( 'Hash Size Name\n' + - 'QmQQHYDwAQms78fPcvx1uFFsfho23YJNoewfLbi9AtdyJ9 123530 blocks/\n' + + 'QmamKEPmEH9RUsqRQsfNf5evZQDQPYL9KXg1ADeT7mkHkT 123530 blocks/\n' + 'QmPkWYfSLCEBLZu7BZt4kigGDMe3cpogMbeVf97gN2xJDN 3939 config\n' + - 'Qma13ZrhKG52MWnwtZ6fMD8jGj8d4Q9sJgn5xtKgeZw5uz 5503 datastore/\n' + + 'QmUqyZtPmsRy1U5Mo8kz2BAMmk1hfJ7yW1KAFTMB2odsFv 5503 datastore/\n' + 'QmUhUuiTKkkK8J6JZ9zmj8iNHPuNfGYcszgRumzhHBxEEU 7397 init-docs/\n' + 'QmR56UJmAaZLXLdTT1ALrE9vVqV8soUEekm9BMd4FnuYqV 10 version\n' ) @@ -54,7 +54,7 @@ describe('ls', () => runOnAndOff((thing) => { it('follows a path, /', function () { this.timeout(20 * 1000) - return ipfs('ls /ipfs/QmYmW4HiZhotsoSqnv2o1oUusvkRM8b9RweBoH7ao5nki2/init-docs') + return ipfs('ls /ipfs/Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z/init-docs') .then((out) => { expect(out).to.eql( 'QmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V 1688 about\n' + @@ -73,7 +73,7 @@ describe('ls', () => runOnAndOff((thing) => { this.slow(2000) this.timeout(20 * 1000) - return ipfs('ls -r /ipfs/QmYmW4HiZhotsoSqnv2o1oUusvkRM8b9RweBoH7ao5nki2/init-docs') + return ipfs('ls -r /ipfs/Qmaj2NmcyAXT8dFmZRRytE12wpcaHADzbChKToMEjBsj5Z/init-docs') .then(out => { expect(out).to.eql( 'QmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V 1688 about\n' +