fix typo
This commit is contained in:
parent
ac443cd758
commit
0f3ff9e06a
22
extern/sector-storage/piece_provider_test.go
vendored
22
extern/sector-storage/piece_provider_test.go
vendored
@ -54,7 +54,7 @@ func TestPieceProviderSimpleNoRemoteWorker(t *testing.T) {
|
|||||||
preCommit1 := ppt.preCommit1(t)
|
preCommit1 := ppt.preCommit1(t)
|
||||||
|
|
||||||
// check if IsUnsealed -> true
|
// check if IsUnsealed -> true
|
||||||
require.True(t, ppt.isUnealed(t, storiface.UnpaddedByteIndex(0), size))
|
require.True(t, ppt.isUnsealed(t, storiface.UnpaddedByteIndex(0), size))
|
||||||
// read piece
|
// read piece
|
||||||
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), size,
|
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), size,
|
||||||
false, pieceData)
|
false, pieceData)
|
||||||
@ -63,7 +63,7 @@ func TestPieceProviderSimpleNoRemoteWorker(t *testing.T) {
|
|||||||
ppt.preCommit2(t, preCommit1)
|
ppt.preCommit2(t, preCommit1)
|
||||||
|
|
||||||
// check if IsUnsealed -> true
|
// check if IsUnsealed -> true
|
||||||
require.True(t, ppt.isUnealed(t, storiface.UnpaddedByteIndex(0), size))
|
require.True(t, ppt.isUnsealed(t, storiface.UnpaddedByteIndex(0), size))
|
||||||
// read piece
|
// read piece
|
||||||
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), size,
|
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), size,
|
||||||
false, pieceData)
|
false, pieceData)
|
||||||
@ -72,13 +72,13 @@ func TestPieceProviderSimpleNoRemoteWorker(t *testing.T) {
|
|||||||
ppt.finalizeSector(t, nil)
|
ppt.finalizeSector(t, nil)
|
||||||
|
|
||||||
// check if IsUnsealed -> false
|
// check if IsUnsealed -> false
|
||||||
require.False(t, ppt.isUnealed(t, storiface.UnpaddedByteIndex(0), size))
|
require.False(t, ppt.isUnsealed(t, storiface.UnpaddedByteIndex(0), size))
|
||||||
// Read the piece -> will have to unseal
|
// Read the piece -> will have to unseal
|
||||||
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), size,
|
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), size,
|
||||||
true, pieceData)
|
true, pieceData)
|
||||||
|
|
||||||
// check if IsUnsealed -> true
|
// check if IsUnsealed -> true
|
||||||
require.True(t, ppt.isUnealed(t, storiface.UnpaddedByteIndex(0), size))
|
require.True(t, ppt.isUnsealed(t, storiface.UnpaddedByteIndex(0), size))
|
||||||
// read the piece -> will not have to unseal
|
// read the piece -> will not have to unseal
|
||||||
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), size,
|
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), size,
|
||||||
false, pieceData)
|
false, pieceData)
|
||||||
@ -128,7 +128,7 @@ func TestReadPieceRemoteWorkers(t *testing.T) {
|
|||||||
pC1 := ppt.preCommit1(t)
|
pC1 := ppt.preCommit1(t)
|
||||||
|
|
||||||
// check if IsUnsealed -> true
|
// check if IsUnsealed -> true
|
||||||
require.True(t, ppt.isUnealed(t, storiface.UnpaddedByteIndex(0), pd1size))
|
require.True(t, ppt.isUnsealed(t, storiface.UnpaddedByteIndex(0), pd1size))
|
||||||
// Read the piece -> no need to unseal
|
// Read the piece -> no need to unseal
|
||||||
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), pd1size,
|
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), pd1size,
|
||||||
false, pd1)
|
false, pd1)
|
||||||
@ -137,7 +137,7 @@ func TestReadPieceRemoteWorkers(t *testing.T) {
|
|||||||
ppt.preCommit2(t, pC1)
|
ppt.preCommit2(t, pC1)
|
||||||
|
|
||||||
// check if IsUnsealed -> true
|
// check if IsUnsealed -> true
|
||||||
require.True(t, ppt.isUnealed(t, storiface.UnpaddedByteIndex(0), pd1size))
|
require.True(t, ppt.isUnsealed(t, storiface.UnpaddedByteIndex(0), pd1size))
|
||||||
// Read the piece -> no need to unseal
|
// Read the piece -> no need to unseal
|
||||||
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), pd1size,
|
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), pd1size,
|
||||||
false, pd1)
|
false, pd1)
|
||||||
@ -148,7 +148,7 @@ func TestReadPieceRemoteWorkers(t *testing.T) {
|
|||||||
ppt.finalizeSector(t, nil)
|
ppt.finalizeSector(t, nil)
|
||||||
|
|
||||||
// check if IsUnsealed -> false
|
// check if IsUnsealed -> false
|
||||||
require.False(t, ppt.isUnealed(t, storiface.UnpaddedByteIndex(0), pd1size))
|
require.False(t, ppt.isUnsealed(t, storiface.UnpaddedByteIndex(0), pd1size))
|
||||||
// Read the piece -> have to unseal since we removed the file.
|
// Read the piece -> have to unseal since we removed the file.
|
||||||
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), pd1size,
|
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), pd1size,
|
||||||
true, pd1)
|
true, pd1)
|
||||||
@ -159,12 +159,12 @@ func TestReadPieceRemoteWorkers(t *testing.T) {
|
|||||||
// remove the unsealed file and read again -> will have to unseal.
|
// remove the unsealed file and read again -> will have to unseal.
|
||||||
ppt.removeAllUnsealedSectorFiles(t)
|
ppt.removeAllUnsealedSectorFiles(t)
|
||||||
// check if IsUnsealed -> false
|
// check if IsUnsealed -> false
|
||||||
require.False(t, ppt.isUnealed(t, storiface.UnpaddedByteIndex(0), pd1size))
|
require.False(t, ppt.isUnsealed(t, storiface.UnpaddedByteIndex(0), pd1size))
|
||||||
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), pd1size,
|
ppt.readPiece(t, storiface.UnpaddedByteIndex(0), pd1size,
|
||||||
true, pd1)
|
true, pd1)
|
||||||
|
|
||||||
// check if IsUnsealed -> true
|
// check if IsUnsealed -> true
|
||||||
require.True(t, ppt.isUnealed(t, storiface.UnpaddedByteIndex(pd1size), pd2size))
|
require.True(t, ppt.isUnsealed(t, storiface.UnpaddedByteIndex(pd1size), pd2size))
|
||||||
// Read Piece 2 -> no unsealing as it got unsealed above.
|
// Read Piece 2 -> no unsealing as it got unsealed above.
|
||||||
ppt.readPiece(t, storiface.UnpaddedByteIndex(pd1size), pd2size, false, pd2)
|
ppt.readPiece(t, storiface.UnpaddedByteIndex(pd1size), pd2size, false, pd2)
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ func TestReadPieceRemoteWorkers(t *testing.T) {
|
|||||||
ppt.removeAllUnsealedSectorFiles(t)
|
ppt.removeAllUnsealedSectorFiles(t)
|
||||||
|
|
||||||
// check if IsUnsealed -> false
|
// check if IsUnsealed -> false
|
||||||
require.False(t, ppt.isUnealed(t, storiface.UnpaddedByteIndex(pd1size), pd2size))
|
require.False(t, ppt.isUnsealed(t, storiface.UnpaddedByteIndex(pd1size), pd2size))
|
||||||
ppt.readPiece(t, storiface.UnpaddedByteIndex(pd1size), pd2size, true, pd2)
|
ppt.readPiece(t, storiface.UnpaddedByteIndex(pd1size), pd2size, true, pd2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -329,7 +329,7 @@ func (p *pieceProviderTestHarness) preCommit2(t *testing.T, pc1 specstorage.PreC
|
|||||||
p.commD = commD
|
p.commD = commD
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *pieceProviderTestHarness) isUnealed(t *testing.T, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) bool {
|
func (p *pieceProviderTestHarness) isUnsealed(t *testing.T, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) bool {
|
||||||
b, err := p.pp.IsUnsealed(p.ctx, p.sector, offset, size)
|
b, err := p.pp.IsUnsealed(p.ctx, p.sector, offset, size)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
return b
|
return b
|
||||||
|
Loading…
Reference in New Issue
Block a user