2017-07-30 15:45:28 +01:00
|
|
|
|
// /***************************************************************************
|
2020-07-25 02:01:36 +01:00
|
|
|
|
// Aaru Data Preservation Suite
|
2017-07-30 15:45:28 +01:00
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
2017-07-30 15:46:08 +01:00
|
|
|
|
// Filename : Sun.cs
|
2017-12-19 03:50:57 +00:00
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
2017-07-30 15:45:28 +01:00
|
|
|
|
//
|
2020-07-25 02:01:36 +01:00
|
|
|
|
// Component : Aaru unit testing.
|
2017-07-30 15:45:28 +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-30 15:45:28 +01:00
|
|
|
|
// ****************************************************************************/
|
2017-12-19 03:50:57 +00:00
|
|
|
|
|
2017-07-30 15:45:28 +01:00
|
|
|
|
using System.IO;
|
2020-02-27 00:33:26 +00:00
|
|
|
|
using Aaru.CommonTypes;
|
2017-07-30 15:45:28 +01:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
2020-02-27 00:33:26 +00:00
|
|
|
|
namespace Aaru.Tests.Partitions
|
2017-07-30 15:45:28 +01:00
|
|
|
|
{
|
2017-07-30 15:46:08 +01:00
|
|
|
|
// TODO: Get SunOS and VTOC16 disk labels
|
2017-07-30 15:45:28 +01:00
|
|
|
|
[TestFixture]
|
2021-03-03 14:52:05 +00:00
|
|
|
|
public class Sun : PartitionSchemeTest
|
2017-07-30 15:45:28 +01:00
|
|
|
|
{
|
2021-03-03 14:52:05 +00:00
|
|
|
|
public override string DataFolder => Path.Combine(Consts.TEST_FILES_ROOT, "Partitioning schemes", "Sun");
|
|
|
|
|
|
|
2021-03-03 15:11:22 +00:00
|
|
|
|
public override PartitionTest[] Tests => new[]
|
2020-02-29 18:03:35 +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 = "linux.aif",
|
|
|
|
|
|
Partitions = new[]
|
2017-12-19 20:33:03 +00:00
|
|
|
|
{
|
2021-03-03 15:11:22 +00:00
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 204800,
|
|
|
|
|
|
Offset = 0,
|
|
|
|
|
|
Sequence = 0,
|
|
|
|
|
|
Size = 0,
|
|
|
|
|
|
Start = 0,
|
|
|
|
|
|
Type = "Linux"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 102400,
|
|
|
|
|
|
Offset = 0,
|
|
|
|
|
|
Sequence = 1,
|
|
|
|
|
|
Size = 0,
|
|
|
|
|
|
Start = 208845,
|
|
|
|
|
|
Type = "Sun boot"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 102400,
|
|
|
|
|
|
Offset = 0,
|
|
|
|
|
|
Sequence = 2,
|
|
|
|
|
|
Size = 0,
|
|
|
|
|
|
Start = 321300,
|
|
|
|
|
|
Type = "Sun /"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 102400,
|
|
|
|
|
|
Offset = 0,
|
|
|
|
|
|
Sequence = 3,
|
|
|
|
|
|
Size = 0,
|
|
|
|
|
|
Start = 433755,
|
|
|
|
|
|
Type = "Sun /home"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 153600,
|
|
|
|
|
|
Offset = 0,
|
|
|
|
|
|
Sequence = 4,
|
|
|
|
|
|
Size = 0,
|
|
|
|
|
|
Start = 546210,
|
|
|
|
|
|
Type = "Sun swap"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 208845,
|
|
|
|
|
|
Offset = 0,
|
|
|
|
|
|
Sequence = 5,
|
|
|
|
|
|
Size = 0,
|
|
|
|
|
|
Start = 706860,
|
|
|
|
|
|
Type = "Sun /usr"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 96390,
|
|
|
|
|
|
Offset = 0,
|
|
|
|
|
|
Sequence = 6,
|
|
|
|
|
|
Size = 0,
|
|
|
|
|
|
Start = 915705,
|
|
|
|
|
|
Type = "Linux swap"
|
|
|
|
|
|
}
|
2017-12-21 02:52:12 +00:00
|
|
|
|
}
|
2017-07-30 15:45:28 +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 = "parted.aif",
|
|
|
|
|
|
Partitions = new[]
|
2017-12-19 20:33:03 +00:00
|
|
|
|
{
|
2021-03-03 15:11:22 +00:00
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 49152,
|
|
|
|
|
|
Offset = 0,
|
|
|
|
|
|
Sequence = 0,
|
|
|
|
|
|
Size = 0,
|
|
|
|
|
|
Start = 0,
|
|
|
|
|
|
Type = "Linux"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 80325,
|
|
|
|
|
|
Offset = 0,
|
|
|
|
|
|
Sequence = 1,
|
|
|
|
|
|
Size = 0,
|
|
|
|
|
|
Start = 64260,
|
|
|
|
|
|
Type = "Linux"
|
|
|
|
|
|
},
|
|
|
|
|
|
new Partition
|
|
|
|
|
|
{
|
|
|
|
|
|
Length = 96390,
|
|
|
|
|
|
Offset = 0,
|
|
|
|
|
|
Sequence = 2,
|
|
|
|
|
|
Size = 0,
|
|
|
|
|
|
Start = 144585,
|
|
|
|
|
|
Type = "Linux"
|
|
|
|
|
|
}
|
2017-12-21 02:52:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
};
|
2017-07-30 15:45:28 +01:00
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
}
|