2017-12-19 03:50:57 +00:00
|
|
|
|
// /***************************************************************************
|
2020-07-25 02:01:36 +01:00
|
|
|
|
// Aaru Data Preservation Suite
|
2017-07-05 06:54:50 +01:00
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Filename : ext2.cs
|
2017-12-19 03:50:57 +00:00
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
2017-07-05 06:54:50 +01:00
|
|
|
|
//
|
2020-07-25 02:01:36 +01:00
|
|
|
|
// Component : Aaru unit testing.
|
2017-07-05 06:54:50 +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-05 06:54:50 +01:00
|
|
|
|
// ****************************************************************************/
|
2017-12-19 03:50:57 +00:00
|
|
|
|
|
2017-07-05 06:55:25 +01:00
|
|
|
|
using System.IO;
|
2020-02-27 00:33:26 +00:00
|
|
|
|
using Aaru.CommonTypes;
|
|
|
|
|
|
using Aaru.CommonTypes.Interfaces;
|
|
|
|
|
|
using Aaru.Filesystems;
|
2017-07-05 06:55:25 +01:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
2020-02-27 00:33:26 +00:00
|
|
|
|
namespace Aaru.Tests.Filesystems
|
2017-07-05 06:54:50 +01:00
|
|
|
|
{
|
2017-07-05 06:55:25 +01:00
|
|
|
|
[TestFixture]
|
2021-03-01 19:34:30 +00:00
|
|
|
|
public class Ext2 : FilesystemTest
|
2017-07-05 06:54:50 +01:00
|
|
|
|
{
|
2021-03-01 21:33:58 +00:00
|
|
|
|
public override string DataFolder => Path.Combine(Consts.TEST_FILES_ROOT, "Filesystems", "ext2");
|
|
|
|
|
|
public override IFilesystem Plugin => new ext2FS();
|
|
|
|
|
|
public override bool Partitions => true;
|
2021-03-01 19:34:30 +00:00
|
|
|
|
|
2021-03-01 21:18:02 +00:00
|
|
|
|
public override FileSystemTest[] Tests => new[]
|
2017-12-19 20:33:03 +00:00
|
|
|
|
{
|
2021-03-01 21:18:02 +00:00
|
|
|
|
new FileSystemTest
|
2021-05-05 01:50:19 +01:00
|
|
|
|
{
|
|
|
|
|
|
TestFile = "netbsd_6.1.5.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131040,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "Volume label",
|
|
|
|
|
|
VolumeSerial = "a4a95973-ab77-11eb-811f-08002792bfed"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "netbsd_6.1.5_r0.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131040,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "Volume label",
|
|
|
|
|
|
VolumeSerial = "19b1dda1-ab75-11eb-a6ba-08002792bfed"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
2021-03-01 21:18:02 +00:00
|
|
|
|
{
|
|
|
|
|
|
TestFile = "netbsd_7.1.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
2021-05-05 01:50:19 +01:00
|
|
|
|
Sectors = 262144,
|
2021-03-01 21:18:02 +00:00
|
|
|
|
SectorSize = 512,
|
2021-05-05 01:50:19 +01:00
|
|
|
|
Clusters = 130540,
|
|
|
|
|
|
ClusterSize = 1024,
|
2021-03-01 21:18:02 +00:00
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "Volume label",
|
2021-05-05 01:50:19 +01:00
|
|
|
|
VolumeSerial = "7f49b17e-ab5d-11eb-bc21-0800272a08ec"
|
2021-03-01 21:18:02 +00:00
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "netbsd_7.1_r0.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
2021-05-05 01:50:19 +01:00
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131040,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "Volume label",
|
|
|
|
|
|
VolumeSerial = "e2601450-ab5c-11eb-a154-0800272a08ec"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "openbsd_4.7.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
2021-03-01 21:18:02 +00:00
|
|
|
|
SectorSize = 512,
|
2021-05-05 01:50:19 +01:00
|
|
|
|
Clusters = 131040,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "Volume label",
|
|
|
|
|
|
VolumeSerial = "0b2bb462-17ac-c444-8ff0-ab10537ae902"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "openbsd_4.7_r0.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131040,
|
|
|
|
|
|
ClusterSize = 1024,
|
2021-03-01 21:18:02 +00:00
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "Volume label",
|
2021-05-05 01:50:19 +01:00
|
|
|
|
VolumeSerial = "32e4de93-37f9-6747-9650-ae7b1f1bb901"
|
2021-03-01 21:18:02 +00:00
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_4.19_ext2_flashdrive.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 1024000,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 510976,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "DicSetter",
|
|
|
|
|
|
VolumeSerial = "f5b2500f-99fb-764b-a6c4-c4db0b98a653"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
2021-05-14 00:07:03 +01:00
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.0.0.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.0.29.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "VolumeLabel",
|
|
|
|
|
|
VolumeSerial = "a81d28a3-83b2-eb11-9ae7-525400123456"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.0.29_r0.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "VolumeLabel",
|
|
|
|
|
|
VolumeSerial = "1a4fbe63-84b2-eb11-9bda-525400123456"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.0.34.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "VolumeLabel",
|
|
|
|
|
|
VolumeSerial = "00d2a5e7-fab2-eb11-8eae-525400123456"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.0.34_r0.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "VolumeLabel",
|
|
|
|
|
|
VolumeSerial = "3e1dfd3a-f9b2-eb11-8384-525400123456"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.0.37.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "Volume label",
|
|
|
|
|
|
VolumeSerial = "ccac0734-e6b3-eb11-885b-525400123456"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.0.37_r0.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "Volume label",
|
|
|
|
|
|
VolumeSerial = "a85e3131-e6b3-eb11-886c-525400123456"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.0.38.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "VolumeLabel",
|
|
|
|
|
|
VolumeSerial = "e48311a9-0fb3-eb11-83ed-525400123456"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.0.38_r0.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "VolumeLabel",
|
|
|
|
|
|
VolumeSerial = "86e00f25-0fb3-eb11-8f77-525400123456"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.2.17.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "VolumeLabel",
|
|
|
|
|
|
VolumeSerial = "9bdfe82d-778f-c64a-816c-a5ab33eb4f52"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.2.17_r0.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "VolumeLabel",
|
|
|
|
|
|
VolumeSerial = "6248975a-8692-bc42-bf66-22790157be29"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.2.20.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "VolumeLabel",
|
|
|
|
|
|
VolumeSerial = "e7263487-cec2-3444-8e58-218181083a89"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.2.20_r0.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "VolumeLabel",
|
|
|
|
|
|
VolumeSerial = "d227254f-b684-2244-9ad1-23b95e331c95"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.4.18.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "VolumeLabel",
|
|
|
|
|
|
VolumeSerial = "7f1a86dd-18a7-7d4e-aef0-728b1f674001"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.4.18_r0.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext2",
|
|
|
|
|
|
VolumeName = "VolumeLabel",
|
|
|
|
|
|
VolumeSerial = "c9e61e78-98c3-844e-98d5-d54b880d07cb"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_2.4.18_ext3.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 262144,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 131008,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext3",
|
|
|
|
|
|
VolumeName = "VolumeLabel",
|
|
|
|
|
|
VolumeSerial = "40bb6664-4e0e-ca4b-a328-7c744ddd8bf4"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
2021-03-01 21:18:02 +00:00
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_4.19_ext3_flashdrive.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 1024000,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 510976,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext3",
|
|
|
|
|
|
VolumeName = "DicSetter",
|
|
|
|
|
|
VolumeSerial = "a3914b55-260f-7245-8c72-7ccdf45436cb"
|
|
|
|
|
|
},
|
|
|
|
|
|
new FileSystemTest
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "linux_4.19_ext4_flashdrive.aif",
|
|
|
|
|
|
MediaType = MediaType.GENERIC_HDD,
|
|
|
|
|
|
Sectors = 1024000,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
Clusters = 510976,
|
|
|
|
|
|
ClusterSize = 1024,
|
|
|
|
|
|
Type = "ext4",
|
|
|
|
|
|
VolumeName = "DicSetter",
|
|
|
|
|
|
VolumeSerial = "10413797-43d1-6545-8fbc-6ebc9d328be9"
|
|
|
|
|
|
}
|
2017-07-05 06:55:25 +01:00
|
|
|
|
};
|
2017-07-05 06:54:50 +01:00
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
}
|