2017-07-18 06:33:47 +01:00
|
|
|
|
// /***************************************************************************
|
2020-07-25 02:01:36 +01:00
|
|
|
|
// Aaru Data Preservation Suite
|
2017-07-18 06:33:47 +01:00
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
2017-07-18 06:34:06 +01:00
|
|
|
|
// Filename : BSD.cs
|
2017-12-19 03:50:57 +00:00
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
2017-07-18 06:33:47 +01:00
|
|
|
|
//
|
2020-07-25 02:01:36 +01:00
|
|
|
|
// Component : Aaru unit testing.
|
2017-07-18 06:33:47 +01:00
|
|
|
|
//
|
|
|
|
|
|
// --[ License ] --------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
|
// it under the terms of the GNU General Public License as
|
|
|
|
|
|
// published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
|
|
//
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
//
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
//
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2020-12-31 23:08:23 +00:00
|
|
|
|
// Copyright © 2011-2021 Natalia Portillo
|
2017-07-18 06:33:47 +01:00
|
|
|
|
// ****************************************************************************/
|
2017-12-19 03:50:57 +00:00
|
|
|
|
|
2017-07-18 06:33:47 +01:00
|
|
|
|
using System.IO;
|
2020-02-27 00:33:26 +00:00
|
|
|
|
using Aaru.CommonTypes;
|
2017-07-18 06:33:47 +01:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
2020-02-27 00:33:26 +00:00
|
|
|
|
namespace Aaru.Tests.Partitions
|
2017-07-18 06:33:47 +01:00
|
|
|
|
{
|
|
|
|
|
|
[TestFixture]
|
2021-03-03 14:52:05 +00:00
|
|
|
|
public class Bsd : PartitionSchemeTest
|
2017-07-18 06:33:47 +01:00
|
|
|
|
{
|
2021-03-03 14:52:05 +00:00
|
|
|
|
public override string DataFolder => Path.Combine(Consts.TEST_FILES_ROOT, "Partitioning schemes", "BSD slices");
|
|
|
|
|
|
|
2021-03-03 15:11:22 +00:00
|
|
|
|
public override PartitionTest[] Tests => new[]
|
2018-12-31 13:17:27 +00:00
|
|
|
|
{
|
2021-03-03 15:11:22 +00:00
|
|
|
|
new PartitionTest
|
2017-12-19 20:33:03 +00:00
|
|
|
|
{
|
2021-03-03 15:11:22 +00:00
|
|
|
|
TestFile = "parted.aif",
|
|
|
|
|
|
Partitions = new[]
|
2017-12-19 20:33:03 +00:00
|
|
|
|
{
|
2021-03-03 15:11:22 +00:00
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 75776,
|
|
|
|
|
|
Offset = 1048576,
|
|
|
|
|
|
Sequence = 0,
|
|
|
|
|
|
Size = 38797312,
|
|
|
|
|
|
Start = 2048,
|
|
|
|
|
|
Type = "FAT"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 38912,
|
|
|
|
|
|
Offset = 40894464,
|
|
|
|
|
|
Sequence = 1,
|
|
|
|
|
|
Size = 19922944,
|
|
|
|
|
|
Start = 79872,
|
|
|
|
|
|
Type = "FAT"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 94208,
|
|
|
|
|
|
Offset = 61865984,
|
|
|
|
|
|
Sequence = 2,
|
|
|
|
|
|
Size = 48234496,
|
|
|
|
|
|
Start = 120832,
|
|
|
|
|
|
Type = "FAT"
|
|
|
|
|
|
}
|
2017-12-21 02:52:12 +00:00
|
|
|
|
}
|
2017-07-18 06:33:47 +01:00
|
|
|
|
},
|
2021-03-03 15:11:22 +00:00
|
|
|
|
new PartitionTest
|
2017-12-19 20:33:03 +00:00
|
|
|
|
{
|
2021-03-03 15:11:22 +00:00
|
|
|
|
TestFile = "netbsd_1.6.aif",
|
|
|
|
|
|
Partitions = new[]
|
2017-12-19 20:33:03 +00:00
|
|
|
|
{
|
2021-03-03 15:11:22 +00:00
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 20417,
|
|
|
|
|
|
Offset = 516096,
|
|
|
|
|
|
Sequence = 0,
|
|
|
|
|
|
Size = 10453504,
|
|
|
|
|
|
Start = 1008,
|
|
|
|
|
|
Type = "FAT"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 409600,
|
|
|
|
|
|
Offset = 11354112,
|
|
|
|
|
|
Sequence = 1,
|
|
|
|
|
|
Size = 209715200,
|
|
|
|
|
|
Start = 22176,
|
|
|
|
|
|
Type = "FAT"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 1572864,
|
|
|
|
|
|
Offset = 221405184,
|
|
|
|
|
|
Sequence = 2,
|
|
|
|
|
|
Size = 805306368,
|
|
|
|
|
|
Start = 432432,
|
|
|
|
|
|
Type = "FAT"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 1460266,
|
|
|
|
|
|
Offset = 1027031040,
|
|
|
|
|
|
Sequence = 3,
|
|
|
|
|
|
Size = 747656192,
|
|
|
|
|
|
Start = 2005920,
|
|
|
|
|
|
Type = "4.2BSD Fast File System"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 524288,
|
|
|
|
|
|
Offset = 1774854144,
|
|
|
|
|
|
Sequence = 4,
|
|
|
|
|
|
Size = 268435456,
|
|
|
|
|
|
Start = 3466512,
|
|
|
|
|
|
Type = "4.4LFS"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 202624,
|
|
|
|
|
|
Offset = 2043740160,
|
|
|
|
|
|
Sequence = 5,
|
|
|
|
|
|
Size = 103743488,
|
|
|
|
|
|
Start = 3991680,
|
|
|
|
|
|
Type = "4.2BSD Fast File System"
|
|
|
|
|
|
}
|
2017-12-21 02:52:12 +00:00
|
|
|
|
}
|
2017-07-26 23:35:35 +01:00
|
|
|
|
},
|
2021-03-03 15:11:22 +00:00
|
|
|
|
new PartitionTest
|
2017-12-19 20:33:03 +00:00
|
|
|
|
{
|
2021-03-03 15:11:22 +00:00
|
|
|
|
TestFile = "netbsd_6.1.5.aif",
|
|
|
|
|
|
Partitions = new[]
|
2017-12-19 20:33:03 +00:00
|
|
|
|
{
|
2021-03-03 15:11:22 +00:00
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 20480,
|
|
|
|
|
|
Offset = 516096,
|
|
|
|
|
|
Sequence = 0,
|
|
|
|
|
|
Size = 10485760,
|
|
|
|
|
|
Start = 1008,
|
|
|
|
|
|
Type = "FAT"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 204800,
|
|
|
|
|
|
Offset = 11354112,
|
|
|
|
|
|
Sequence = 1,
|
|
|
|
|
|
Size = 104857600,
|
|
|
|
|
|
Start = 22176,
|
|
|
|
|
|
Type = "FAT"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 409600,
|
|
|
|
|
|
Offset = 116637696,
|
|
|
|
|
|
Sequence = 2,
|
|
|
|
|
|
Size = 209715200,
|
|
|
|
|
|
Start = 227808,
|
|
|
|
|
|
Type = "FAT"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 79632,
|
|
|
|
|
|
Offset = 326688768,
|
|
|
|
|
|
Sequence = 3,
|
|
|
|
|
|
Size = 40771584,
|
|
|
|
|
|
Start = 638064,
|
|
|
|
|
|
Type = "4.2BSD Fast File System"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 819200,
|
|
|
|
|
|
Offset = 367460352,
|
|
|
|
|
|
Sequence = 4,
|
|
|
|
|
|
Size = 419430400,
|
|
|
|
|
|
Start = 717696,
|
|
|
|
|
|
Type = "4.2BSD Fast File System"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 921600,
|
|
|
|
|
|
Offset = 787562496,
|
|
|
|
|
|
Sequence = 5,
|
|
|
|
|
|
Size = 471859200,
|
|
|
|
|
|
Start = 1538208,
|
|
|
|
|
|
Type = "4.2BSD Fast File System"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 153600,
|
|
|
|
|
|
Offset = 1259790336,
|
|
|
|
|
|
Sequence = 6,
|
|
|
|
|
|
Size = 78643200,
|
|
|
|
|
|
Start = 2460528,
|
|
|
|
|
|
Type = "Hammer"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 194560,
|
|
|
|
|
|
Offset = 1338753024,
|
|
|
|
|
|
Sequence = 7,
|
|
|
|
|
|
Size = 99614720,
|
|
|
|
|
|
Start = 2614752,
|
|
|
|
|
|
Type = "UNIX 7th Edition"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 477184,
|
|
|
|
|
|
Offset = 1438875648,
|
|
|
|
|
|
Sequence = 8,
|
|
|
|
|
|
Size = 244318208,
|
|
|
|
|
|
Start = 2810304,
|
|
|
|
|
|
Type = "4.4LFS"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 906208,
|
|
|
|
|
|
Offset = 1683505152,
|
|
|
|
|
|
Sequence = 9,
|
|
|
|
|
|
Size = 463978496,
|
|
|
|
|
|
Start = 3288096,
|
|
|
|
|
|
Type = "Digital LSM Public Region"
|
|
|
|
|
|
}
|
2017-12-21 02:52:12 +00:00
|
|
|
|
}
|
2017-07-26 23:35:35 +01:00
|
|
|
|
},
|
2021-03-03 15:11:22 +00:00
|
|
|
|
new PartitionTest
|
2017-12-19 20:33:03 +00:00
|
|
|
|
{
|
2021-03-03 15:11:22 +00:00
|
|
|
|
TestFile = "netbsd_7.1.aif",
|
|
|
|
|
|
Partitions = new[]
|
2017-12-19 20:33:03 +00:00
|
|
|
|
{
|
2021-03-03 15:11:22 +00:00
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 20160,
|
|
|
|
|
|
Offset = 516096,
|
|
|
|
|
|
Sequence = 0,
|
|
|
|
|
|
Size = 10321920,
|
|
|
|
|
|
Start = 1008,
|
|
|
|
|
|
Type = "FAT"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 204624,
|
|
|
|
|
|
Offset = 11354112,
|
|
|
|
|
|
Sequence = 1,
|
|
|
|
|
|
Size = 104767488,
|
|
|
|
|
|
Start = 22176,
|
|
|
|
|
|
Type = "FAT"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 409248,
|
|
|
|
|
|
Offset = 116637696,
|
|
|
|
|
|
Sequence = 2,
|
|
|
|
|
|
Size = 209534976,
|
|
|
|
|
|
Start = 227808,
|
|
|
|
|
|
Type = "FAT"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 78624,
|
|
|
|
|
|
Offset = 326688768,
|
|
|
|
|
|
Sequence = 3,
|
|
|
|
|
|
Size = 40255488,
|
|
|
|
|
|
Start = 638064,
|
|
|
|
|
|
Type = "4.2BSD Fast File System"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 818496,
|
|
|
|
|
|
Offset = 367460352,
|
|
|
|
|
|
Sequence = 4,
|
|
|
|
|
|
Size = 419069952,
|
|
|
|
|
|
Start = 717696,
|
|
|
|
|
|
Type = "4.2BSD Fast File System"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 921312,
|
|
|
|
|
|
Offset = 787562496,
|
|
|
|
|
|
Sequence = 5,
|
|
|
|
|
|
Size = 471711744,
|
|
|
|
|
|
Start = 1538208,
|
|
|
|
|
|
Type = "4.2BSD Fast File System"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 153216,
|
|
|
|
|
|
Offset = 1259790336,
|
|
|
|
|
|
Sequence = 6,
|
|
|
|
|
|
Size = 78446592,
|
|
|
|
|
|
Start = 2460528,
|
|
|
|
|
|
Type = "Hammer"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 194544,
|
|
|
|
|
|
Offset = 1338753024,
|
|
|
|
|
|
Sequence = 7,
|
|
|
|
|
|
Size = 99606528,
|
|
|
|
|
|
Start = 2614752,
|
|
|
|
|
|
Type = "UNIX 7th Edition"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 475776,
|
|
|
|
|
|
Offset = 1438875648,
|
|
|
|
|
|
Sequence = 8,
|
|
|
|
|
|
Size = 243597312,
|
|
|
|
|
|
Start = 2810304,
|
|
|
|
|
|
Type = "4.4LFS"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 906192,
|
|
|
|
|
|
Offset = 1683505152,
|
|
|
|
|
|
Sequence = 9,
|
|
|
|
|
|
Size = 463970304,
|
|
|
|
|
|
Start = 3288096,
|
|
|
|
|
|
Type = "Digital LSM Public Region"
|
|
|
|
|
|
}
|
2017-12-21 02:52:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-07-18 06:34:06 +01:00
|
|
|
|
};
|
2017-07-18 06:33:47 +01:00
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
}
|