mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Added tests for System V filesystem variants (AFS, EAFS, HTFS, DTFS,
COHERENT, XENIX, SVR2 and SVR4).
This commit is contained in:
@@ -166,6 +166,18 @@
|
|||||||
<Compile Include="Partitions\SGI.cs" />
|
<Compile Include="Partitions\SGI.cs" />
|
||||||
<Compile Include="Partitions\Sun.cs" />
|
<Compile Include="Partitions\Sun.cs" />
|
||||||
<Compile Include="Partitions\VTOC.cs" />
|
<Compile Include="Partitions\VTOC.cs" />
|
||||||
|
<Compile Include="Filesystems\XENIX.cs" />
|
||||||
|
<Compile Include="Filesystems\COHERENT.cs" />
|
||||||
|
<Compile Include="Filesystems\HTFS.cs" />
|
||||||
|
<Compile Include="Filesystems\DTFS.cs" />
|
||||||
|
<Compile Include="Filesystems\AFS.cs" />
|
||||||
|
<Compile Include="Filesystems\EAFS.cs" />
|
||||||
|
<Compile Include="Filesystems\XENIX_MBR.cs" />
|
||||||
|
<Compile Include="Filesystems\EAFS_MBR.cs" />
|
||||||
|
<Compile Include="Filesystems\AFS_MBR.cs" />
|
||||||
|
<Compile Include="Filesystems\COHERENT_MBR.cs" />
|
||||||
|
<Compile Include="Filesystems\HTFS_MBR.cs" />
|
||||||
|
<Compile Include="Filesystems\DTFS_MBR.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
|
|||||||
125
DiscImageChef.Tests/Filesystems/AFS.cs
Normal file
125
DiscImageChef.Tests/Filesystems/AFS.cs
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// The Disc Image Chef
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : AFS.cs
|
||||||
|
// Version : 1.0
|
||||||
|
// Author(s) : Natalia Portillo
|
||||||
|
//
|
||||||
|
// Component : Component
|
||||||
|
//
|
||||||
|
// Revision : $Revision$
|
||||||
|
// Last change by : $Author$
|
||||||
|
// Date : $Date$
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description
|
||||||
|
//
|
||||||
|
// --[ 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/>.
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2011-2015 Claunia.com
|
||||||
|
// ****************************************************************************/
|
||||||
|
// //$Id$
|
||||||
|
using System.IO;
|
||||||
|
using DiscImageChef.CommonTypes;
|
||||||
|
using DiscImageChef.Filesystems;
|
||||||
|
using DiscImageChef.Filters;
|
||||||
|
using DiscImageChef.ImagePlugins;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Tests.Filesystems
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class AFS
|
||||||
|
{
|
||||||
|
readonly string[] testfiles = {
|
||||||
|
"scoopenserver_5.0.7hw_dmf.img.lz", "scoopenserver_5.0.7hw_dshd.img.lz", "scoopenserver_5.0.7hw_mf2dd.img.lz", "scoopenserver_5.0.7hw_mf2ed.img.lz",
|
||||||
|
"scoopenserver_5.0.7hw_mf2hd.img.lz",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly MediaType[] mediatypes = {
|
||||||
|
MediaType.DMF, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_ED,
|
||||||
|
MediaType.DOS_35_HD,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly ulong[] sectors = {
|
||||||
|
3360, 2400, 1440, 5760,
|
||||||
|
2880,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly uint[] sectorsize = {
|
||||||
|
512, 512, 512, 512,
|
||||||
|
512,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly long[] clusters = {
|
||||||
|
1680, 1200, 720, 2880,
|
||||||
|
1440,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly int[] clustersize = {
|
||||||
|
1024, 1024, 1024, 1024,
|
||||||
|
1024,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumename = {
|
||||||
|
"", "", "", "",
|
||||||
|
"",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumeserial = {
|
||||||
|
null, null, null, null,
|
||||||
|
null,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] type = {
|
||||||
|
"Acer Fast Filesystem", "Acer Fast Filesystem", "Acer Fast Filesystem", "Acer Fast Filesystem",
|
||||||
|
"Acer Fast Filesystem",
|
||||||
|
};
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test()
|
||||||
|
{
|
||||||
|
for(int i = 0; i < testfiles.Length; i++)
|
||||||
|
{
|
||||||
|
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "afs", testfiles[i]);
|
||||||
|
Filter filter = new LZip();
|
||||||
|
filter.Open(location);
|
||||||
|
ImagePlugin image = new ZZZRawImage();
|
||||||
|
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
|
||||||
|
Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
|
||||||
|
Filesystem fs = new DiscImageChef.Filesystems.SysVfs();
|
||||||
|
Partition wholePart = new Partition
|
||||||
|
{
|
||||||
|
Name = "Whole device",
|
||||||
|
Length = image.ImageInfo.sectors,
|
||||||
|
Size = image.ImageInfo.sectors * image.ImageInfo.sectorSize
|
||||||
|
};
|
||||||
|
Assert.AreEqual(true, fs.Identify(image, wholePart), testfiles[i]);
|
||||||
|
fs.GetInformation(image, wholePart, out string information);
|
||||||
|
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
|
||||||
|
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
|
||||||
|
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
119
DiscImageChef.Tests/Filesystems/AFS_MBR.cs
Normal file
119
DiscImageChef.Tests/Filesystems/AFS_MBR.cs
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// The Disc Image Chef
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : SysV_MBR.cs
|
||||||
|
// Version : 1.0
|
||||||
|
// Author(s) : Natalia Portillo
|
||||||
|
//
|
||||||
|
// Component : Component
|
||||||
|
//
|
||||||
|
// Revision : $Revision$
|
||||||
|
// Last change by : $Author$
|
||||||
|
// Date : $Date$
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description
|
||||||
|
//
|
||||||
|
// --[ 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/>.
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2011-2015 Claunia.com
|
||||||
|
// ****************************************************************************/
|
||||||
|
// //$Id$
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using DiscImageChef.CommonTypes;
|
||||||
|
using DiscImageChef.DiscImages;
|
||||||
|
using DiscImageChef.Filesystems;
|
||||||
|
using DiscImageChef.Filters;
|
||||||
|
using DiscImageChef.ImagePlugins;
|
||||||
|
using DiscImageChef.PartPlugins;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Tests.Filesystems
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class AFS_MBR
|
||||||
|
{
|
||||||
|
readonly string[] testfiles = {
|
||||||
|
"scoopenserver_5.0.7hw.vdi.lz"
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly ulong[] sectors = {
|
||||||
|
1024000,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly uint[] sectorsize = {
|
||||||
|
512,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly long[] clusters = {
|
||||||
|
510048,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly int[] clustersize = {
|
||||||
|
1024,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumename = {
|
||||||
|
"Volume label",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumeserial = {
|
||||||
|
null, null,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] type = {
|
||||||
|
"Acer Fast Filesystem",
|
||||||
|
};
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test()
|
||||||
|
{
|
||||||
|
for(int i = 0; i < testfiles.Length; i++)
|
||||||
|
{
|
||||||
|
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "afs_mbr", testfiles[i]);
|
||||||
|
Filter filter = new LZip();
|
||||||
|
filter.Open(location);
|
||||||
|
ImagePlugin image = new VDI();
|
||||||
|
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
|
||||||
|
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
|
||||||
|
List<Partition> partitions = Core.Partitions.GetAll(image);
|
||||||
|
Filesystem fs = new DiscImageChef.Filesystems.SysVfs();
|
||||||
|
int part = -1;
|
||||||
|
for(int j = 0; j < partitions.Count; j++)
|
||||||
|
{
|
||||||
|
if(partitions[j].Type == "XENIX")
|
||||||
|
{
|
||||||
|
part = j;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i]));
|
||||||
|
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
|
||||||
|
fs.GetInformation(image, partitions[part], out string information);
|
||||||
|
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
|
||||||
|
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
|
||||||
|
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
117
DiscImageChef.Tests/Filesystems/COHERENT.cs
Normal file
117
DiscImageChef.Tests/Filesystems/COHERENT.cs
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// The Disc Image Chef
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : COHERENT.cs
|
||||||
|
// Version : 1.0
|
||||||
|
// Author(s) : Natalia Portillo
|
||||||
|
//
|
||||||
|
// Component : Component
|
||||||
|
//
|
||||||
|
// Revision : $Revision$
|
||||||
|
// Last change by : $Author$
|
||||||
|
// Date : $Date$
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description
|
||||||
|
//
|
||||||
|
// --[ 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/>.
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2011-2015 Claunia.com
|
||||||
|
// ****************************************************************************/
|
||||||
|
// //$Id$
|
||||||
|
using System.IO;
|
||||||
|
using DiscImageChef.CommonTypes;
|
||||||
|
using DiscImageChef.Filesystems;
|
||||||
|
using DiscImageChef.Filters;
|
||||||
|
using DiscImageChef.ImagePlugins;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Tests.Filesystems
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class COHERENT
|
||||||
|
{
|
||||||
|
readonly string[] testfiles = {
|
||||||
|
"coherentunix_4.2.10_dsdd.img.lz", "coherentunix_4.2.10_dshd.img.lz", "coherentunix_4.2.10_mf2dd.img.lz", "coherentunix_4.2.10_mf2hd.img.lz",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly MediaType[] mediatypes = {
|
||||||
|
MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly ulong[] sectors = {
|
||||||
|
720, 2400, 1440, 2880,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly uint[] sectorsize = {
|
||||||
|
512, 512, 512, 512,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly long[] clusters = {
|
||||||
|
720, 2400, 1440, 2880,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly int[] clustersize = {
|
||||||
|
512, 512, 512, 512,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumename = {
|
||||||
|
"noname", "noname", "noname", "noname",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumeserial = {
|
||||||
|
null, null, null, null,
|
||||||
|
null,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] type = {
|
||||||
|
"Coherent fs", "Coherent fs", "Coherent fs", "Coherent fs",
|
||||||
|
};
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test()
|
||||||
|
{
|
||||||
|
for(int i = 0; i < testfiles.Length; i++)
|
||||||
|
{
|
||||||
|
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "coherent", testfiles[i]);
|
||||||
|
Filter filter = new LZip();
|
||||||
|
filter.Open(location);
|
||||||
|
ImagePlugin image = new ZZZRawImage();
|
||||||
|
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
|
||||||
|
Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
|
||||||
|
Filesystem fs = new DiscImageChef.Filesystems.SysVfs();
|
||||||
|
Partition wholePart = new Partition
|
||||||
|
{
|
||||||
|
Name = "Whole device",
|
||||||
|
Length = image.ImageInfo.sectors,
|
||||||
|
Size = image.ImageInfo.sectors * image.ImageInfo.sectorSize
|
||||||
|
};
|
||||||
|
Assert.AreEqual(true, fs.Identify(image, wholePart), testfiles[i]);
|
||||||
|
fs.GetInformation(image, wholePart, out string information);
|
||||||
|
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
|
||||||
|
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
|
||||||
|
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
119
DiscImageChef.Tests/Filesystems/COHERENT_MBR.cs
Normal file
119
DiscImageChef.Tests/Filesystems/COHERENT_MBR.cs
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// The Disc Image Chef
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : SysV_MBR.cs
|
||||||
|
// Version : 1.0
|
||||||
|
// Author(s) : Natalia Portillo
|
||||||
|
//
|
||||||
|
// Component : Component
|
||||||
|
//
|
||||||
|
// Revision : $Revision$
|
||||||
|
// Last change by : $Author$
|
||||||
|
// Date : $Date$
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description
|
||||||
|
//
|
||||||
|
// --[ 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/>.
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2011-2015 Claunia.com
|
||||||
|
// ****************************************************************************/
|
||||||
|
// //$Id$
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using DiscImageChef.CommonTypes;
|
||||||
|
using DiscImageChef.DiscImages;
|
||||||
|
using DiscImageChef.Filesystems;
|
||||||
|
using DiscImageChef.Filters;
|
||||||
|
using DiscImageChef.ImagePlugins;
|
||||||
|
using DiscImageChef.PartPlugins;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Tests.Filesystems
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class COHERENT_MBR
|
||||||
|
{
|
||||||
|
readonly string[] testfiles = {
|
||||||
|
"coherentunix_4.2.10.vdi.lz"
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly ulong[] sectors = {
|
||||||
|
1024000,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly uint[] sectorsize = {
|
||||||
|
512,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly long[] clusters = {
|
||||||
|
510048,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly int[] clustersize = {
|
||||||
|
1024,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumename = {
|
||||||
|
"Volume label",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumeserial = {
|
||||||
|
null,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] type = {
|
||||||
|
"Coherent fs",
|
||||||
|
};
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test()
|
||||||
|
{
|
||||||
|
for(int i = 0; i < testfiles.Length; i++)
|
||||||
|
{
|
||||||
|
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "coherent_mbr", testfiles[i]);
|
||||||
|
Filter filter = new LZip();
|
||||||
|
filter.Open(location);
|
||||||
|
ImagePlugin image = new VDI();
|
||||||
|
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
|
||||||
|
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
|
||||||
|
List<Partition> partitions = Core.Partitions.GetAll(image);
|
||||||
|
Filesystem fs = new DiscImageChef.Filesystems.SysVfs();
|
||||||
|
int part = -1;
|
||||||
|
for(int j = 0; j < partitions.Count; j++)
|
||||||
|
{
|
||||||
|
if(partitions[j].Type == "0x09")
|
||||||
|
{
|
||||||
|
part = j;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i]));
|
||||||
|
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
|
||||||
|
fs.GetInformation(image, partitions[part], out string information);
|
||||||
|
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
|
||||||
|
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
|
||||||
|
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
125
DiscImageChef.Tests/Filesystems/DTFS.cs
Normal file
125
DiscImageChef.Tests/Filesystems/DTFS.cs
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// The Disc Image Chef
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : DTFS.cs
|
||||||
|
// Version : 1.0
|
||||||
|
// Author(s) : Natalia Portillo
|
||||||
|
//
|
||||||
|
// Component : Component
|
||||||
|
//
|
||||||
|
// Revision : $Revision$
|
||||||
|
// Last change by : $Author$
|
||||||
|
// Date : $Date$
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description
|
||||||
|
//
|
||||||
|
// --[ 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/>.
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2011-2015 Claunia.com
|
||||||
|
// ****************************************************************************/
|
||||||
|
// //$Id$
|
||||||
|
using System.IO;
|
||||||
|
using DiscImageChef.CommonTypes;
|
||||||
|
using DiscImageChef.Filesystems;
|
||||||
|
using DiscImageChef.Filters;
|
||||||
|
using DiscImageChef.ImagePlugins;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Tests.Filesystems
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class DTFS
|
||||||
|
{
|
||||||
|
readonly string[] testfiles = {
|
||||||
|
"scoopenserver_5.0.7hw_dmf.img.lz", "scoopenserver_5.0.7hw_dshd.img.lz", "scoopenserver_5.0.7hw_mf2dd.img.lz", "scoopenserver_5.0.7hw_mf2ed.img.lz",
|
||||||
|
"scoopenserver_5.0.7hw_mf2hd.img.lz",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly MediaType[] mediatypes = {
|
||||||
|
MediaType.DMF, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_ED,
|
||||||
|
MediaType.DOS_35_HD,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly ulong[] sectors = {
|
||||||
|
3360, 2400, 1440, 5760,
|
||||||
|
2880,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly uint[] sectorsize = {
|
||||||
|
512, 512, 512, 512,
|
||||||
|
512,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly long[] clusters = {
|
||||||
|
1680, 1200, 720, 2880,
|
||||||
|
1440,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly int[] clustersize = {
|
||||||
|
1024, 1024, 1024, 1024,
|
||||||
|
1024,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumename = {
|
||||||
|
"", "", "", "",
|
||||||
|
"",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumeserial = {
|
||||||
|
null, null, null, null,
|
||||||
|
null,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] type = {
|
||||||
|
"DTFS", "DTFS", "DTFS", "DTFS",
|
||||||
|
"DTFS",
|
||||||
|
};
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test()
|
||||||
|
{
|
||||||
|
for(int i = 0; i < testfiles.Length; i++)
|
||||||
|
{
|
||||||
|
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "dtfs", testfiles[i]);
|
||||||
|
Filter filter = new LZip();
|
||||||
|
filter.Open(location);
|
||||||
|
ImagePlugin image = new ZZZRawImage();
|
||||||
|
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
|
||||||
|
Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
|
||||||
|
Filesystem fs = new DiscImageChef.Filesystems.SysVfs();
|
||||||
|
Partition wholePart = new Partition
|
||||||
|
{
|
||||||
|
Name = "Whole device",
|
||||||
|
Length = image.ImageInfo.sectors,
|
||||||
|
Size = image.ImageInfo.sectors * image.ImageInfo.sectorSize
|
||||||
|
};
|
||||||
|
Assert.AreEqual(true, fs.Identify(image, wholePart), testfiles[i]);
|
||||||
|
fs.GetInformation(image, wholePart, out string information);
|
||||||
|
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
|
||||||
|
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
|
||||||
|
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
119
DiscImageChef.Tests/Filesystems/DTFS_MBR.cs
Normal file
119
DiscImageChef.Tests/Filesystems/DTFS_MBR.cs
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// The Disc Image Chef
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : SysV_MBR.cs
|
||||||
|
// Version : 1.0
|
||||||
|
// Author(s) : Natalia Portillo
|
||||||
|
//
|
||||||
|
// Component : Component
|
||||||
|
//
|
||||||
|
// Revision : $Revision$
|
||||||
|
// Last change by : $Author$
|
||||||
|
// Date : $Date$
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description
|
||||||
|
//
|
||||||
|
// --[ 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/>.
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2011-2015 Claunia.com
|
||||||
|
// ****************************************************************************/
|
||||||
|
// //$Id$
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using DiscImageChef.CommonTypes;
|
||||||
|
using DiscImageChef.DiscImages;
|
||||||
|
using DiscImageChef.Filesystems;
|
||||||
|
using DiscImageChef.Filters;
|
||||||
|
using DiscImageChef.ImagePlugins;
|
||||||
|
using DiscImageChef.PartPlugins;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Tests.Filesystems
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class DTFS_MBR
|
||||||
|
{
|
||||||
|
readonly string[] testfiles = {
|
||||||
|
"scoopenserver_5.0.7hw.vdi.lz"
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly ulong[] sectors = {
|
||||||
|
1024000,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly uint[] sectorsize = {
|
||||||
|
512,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly long[] clusters = {
|
||||||
|
510048,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly int[] clustersize = {
|
||||||
|
1024,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumename = {
|
||||||
|
"Volume label",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumeserial = {
|
||||||
|
null,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] type = {
|
||||||
|
"DTFS",
|
||||||
|
};
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test()
|
||||||
|
{
|
||||||
|
for(int i = 0; i < testfiles.Length; i++)
|
||||||
|
{
|
||||||
|
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "dtfs_mbr", testfiles[i]);
|
||||||
|
Filter filter = new LZip();
|
||||||
|
filter.Open(location);
|
||||||
|
ImagePlugin image = new VDI();
|
||||||
|
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
|
||||||
|
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
|
||||||
|
List<Partition> partitions = Core.Partitions.GetAll(image);
|
||||||
|
Filesystem fs = new DiscImageChef.Filesystems.SysVfs();
|
||||||
|
int part = -1;
|
||||||
|
for(int j = 0; j < partitions.Count; j++)
|
||||||
|
{
|
||||||
|
if(partitions[j].Type == "XENIX")
|
||||||
|
{
|
||||||
|
part = j;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i]));
|
||||||
|
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
|
||||||
|
fs.GetInformation(image, partitions[part], out string information);
|
||||||
|
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
|
||||||
|
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
|
||||||
|
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
125
DiscImageChef.Tests/Filesystems/EAFS.cs
Normal file
125
DiscImageChef.Tests/Filesystems/EAFS.cs
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// The Disc Image Chef
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : EAFS.cs
|
||||||
|
// Version : 1.0
|
||||||
|
// Author(s) : Natalia Portillo
|
||||||
|
//
|
||||||
|
// Component : Component
|
||||||
|
//
|
||||||
|
// Revision : $Revision$
|
||||||
|
// Last change by : $Author$
|
||||||
|
// Date : $Date$
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description
|
||||||
|
//
|
||||||
|
// --[ 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/>.
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2011-2015 Claunia.com
|
||||||
|
// ****************************************************************************/
|
||||||
|
// //$Id$
|
||||||
|
using System.IO;
|
||||||
|
using DiscImageChef.CommonTypes;
|
||||||
|
using DiscImageChef.Filesystems;
|
||||||
|
using DiscImageChef.Filters;
|
||||||
|
using DiscImageChef.ImagePlugins;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Tests.Filesystems
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class EAFS
|
||||||
|
{
|
||||||
|
readonly string[] testfiles = {
|
||||||
|
"scoopenserver_5.0.7hw_dmf.img.lz", "scoopenserver_5.0.7hw_dshd.img.lz", "scoopenserver_5.0.7hw_mf2dd.img.lz", "scoopenserver_5.0.7hw_mf2ed.img.lz",
|
||||||
|
"scoopenserver_5.0.7hw_mf2hd.img.lz",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly MediaType[] mediatypes = {
|
||||||
|
MediaType.DMF, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_ED,
|
||||||
|
MediaType.DOS_35_HD,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly ulong[] sectors = {
|
||||||
|
3360, 2400, 1440, 5760,
|
||||||
|
2880,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly uint[] sectorsize = {
|
||||||
|
512, 512, 512, 512,
|
||||||
|
512,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly long[] clusters = {
|
||||||
|
1680, 1200, 720, 2880,
|
||||||
|
1440,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly int[] clustersize = {
|
||||||
|
1024, 1024, 1024, 1024,
|
||||||
|
1024,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumename = {
|
||||||
|
"", "", "", "",
|
||||||
|
"",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumeserial = {
|
||||||
|
null, null, null, null,
|
||||||
|
null,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] type = {
|
||||||
|
"Extended Acer Fast Filesystem", "Extended Acer Fast Filesystem", "Extended Acer Fast Filesystem", "Extended Acer Fast Filesystem",
|
||||||
|
"Extended Acer Fast Filesystem",
|
||||||
|
};
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test()
|
||||||
|
{
|
||||||
|
for(int i = 0; i < testfiles.Length; i++)
|
||||||
|
{
|
||||||
|
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "eafs", testfiles[i]);
|
||||||
|
Filter filter = new LZip();
|
||||||
|
filter.Open(location);
|
||||||
|
ImagePlugin image = new ZZZRawImage();
|
||||||
|
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
|
||||||
|
Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
|
||||||
|
Filesystem fs = new DiscImageChef.Filesystems.SysVfs();
|
||||||
|
Partition wholePart = new Partition
|
||||||
|
{
|
||||||
|
Name = "Whole device",
|
||||||
|
Length = image.ImageInfo.sectors,
|
||||||
|
Size = image.ImageInfo.sectors * image.ImageInfo.sectorSize
|
||||||
|
};
|
||||||
|
Assert.AreEqual(true, fs.Identify(image, wholePart), testfiles[i]);
|
||||||
|
fs.GetInformation(image, wholePart, out string information);
|
||||||
|
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
|
||||||
|
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
|
||||||
|
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
119
DiscImageChef.Tests/Filesystems/EAFS_MBR.cs
Normal file
119
DiscImageChef.Tests/Filesystems/EAFS_MBR.cs
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// The Disc Image Chef
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : SysV_MBR.cs
|
||||||
|
// Version : 1.0
|
||||||
|
// Author(s) : Natalia Portillo
|
||||||
|
//
|
||||||
|
// Component : Component
|
||||||
|
//
|
||||||
|
// Revision : $Revision$
|
||||||
|
// Last change by : $Author$
|
||||||
|
// Date : $Date$
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description
|
||||||
|
//
|
||||||
|
// --[ 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/>.
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2011-2015 Claunia.com
|
||||||
|
// ****************************************************************************/
|
||||||
|
// //$Id$
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using DiscImageChef.CommonTypes;
|
||||||
|
using DiscImageChef.DiscImages;
|
||||||
|
using DiscImageChef.Filesystems;
|
||||||
|
using DiscImageChef.Filters;
|
||||||
|
using DiscImageChef.ImagePlugins;
|
||||||
|
using DiscImageChef.PartPlugins;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Tests.Filesystems
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class EAFS_MBR
|
||||||
|
{
|
||||||
|
readonly string[] testfiles = {
|
||||||
|
"scoopenserver_5.0.7hw.vdi.lz"
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly ulong[] sectors = {
|
||||||
|
1024000,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly uint[] sectorsize = {
|
||||||
|
512,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly long[] clusters = {
|
||||||
|
510048,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly int[] clustersize = {
|
||||||
|
1024,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumename = {
|
||||||
|
"Volume label",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumeserial = {
|
||||||
|
null,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] type = {
|
||||||
|
"Extended Acer Fast Filesystem",
|
||||||
|
};
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test()
|
||||||
|
{
|
||||||
|
for(int i = 0; i < testfiles.Length; i++)
|
||||||
|
{
|
||||||
|
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "eafs_mbr", testfiles[i]);
|
||||||
|
Filter filter = new LZip();
|
||||||
|
filter.Open(location);
|
||||||
|
ImagePlugin image = new VDI();
|
||||||
|
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
|
||||||
|
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
|
||||||
|
List<Partition> partitions = Core.Partitions.GetAll(image);
|
||||||
|
Filesystem fs = new DiscImageChef.Filesystems.SysVfs();
|
||||||
|
int part = -1;
|
||||||
|
for(int j = 0; j < partitions.Count; j++)
|
||||||
|
{
|
||||||
|
if(partitions[j].Type == "XENIX")
|
||||||
|
{
|
||||||
|
part = j;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i]));
|
||||||
|
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
|
||||||
|
fs.GetInformation(image, partitions[part], out string information);
|
||||||
|
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
|
||||||
|
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
|
||||||
|
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
125
DiscImageChef.Tests/Filesystems/HTFS.cs
Normal file
125
DiscImageChef.Tests/Filesystems/HTFS.cs
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// The Disc Image Chef
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : HTFS.cs
|
||||||
|
// Version : 1.0
|
||||||
|
// Author(s) : Natalia Portillo
|
||||||
|
//
|
||||||
|
// Component : Component
|
||||||
|
//
|
||||||
|
// Revision : $Revision$
|
||||||
|
// Last change by : $Author$
|
||||||
|
// Date : $Date$
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description
|
||||||
|
//
|
||||||
|
// --[ 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/>.
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2011-2015 Claunia.com
|
||||||
|
// ****************************************************************************/
|
||||||
|
// //$Id$
|
||||||
|
using System.IO;
|
||||||
|
using DiscImageChef.CommonTypes;
|
||||||
|
using DiscImageChef.Filesystems;
|
||||||
|
using DiscImageChef.Filters;
|
||||||
|
using DiscImageChef.ImagePlugins;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Tests.Filesystems
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class HTFS
|
||||||
|
{
|
||||||
|
readonly string[] testfiles = {
|
||||||
|
"scoopenserver_5.0.7hw_dmf.img.lz", "scoopenserver_5.0.7hw_dshd.img.lz", "scoopenserver_5.0.7hw_mf2dd.img.lz", "scoopenserver_5.0.7hw_mf2ed.img.lz",
|
||||||
|
"scoopenserver_5.0.7hw_mf2hd.img.lz",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly MediaType[] mediatypes = {
|
||||||
|
MediaType.DMF, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_ED,
|
||||||
|
MediaType.DOS_35_HD,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly ulong[] sectors = {
|
||||||
|
3360, 2400, 1440, 5760,
|
||||||
|
2880,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly uint[] sectorsize = {
|
||||||
|
512, 512, 512, 512,
|
||||||
|
512,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly long[] clusters = {
|
||||||
|
1680, 1200, 720, 2880,
|
||||||
|
1440,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly int[] clustersize = {
|
||||||
|
1024, 1024, 1024, 1024,
|
||||||
|
1024,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumename = {
|
||||||
|
"", "", "", "",
|
||||||
|
"",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumeserial = {
|
||||||
|
null, null, null, null,
|
||||||
|
null,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] type = {
|
||||||
|
"HTFS", "HTFS", "HTFS", "HTFS",
|
||||||
|
"HTFS",
|
||||||
|
};
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test()
|
||||||
|
{
|
||||||
|
for(int i = 0; i < testfiles.Length; i++)
|
||||||
|
{
|
||||||
|
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "htfs", testfiles[i]);
|
||||||
|
Filter filter = new LZip();
|
||||||
|
filter.Open(location);
|
||||||
|
ImagePlugin image = new ZZZRawImage();
|
||||||
|
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
|
||||||
|
Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
|
||||||
|
Filesystem fs = new DiscImageChef.Filesystems.SysVfs();
|
||||||
|
Partition wholePart = new Partition
|
||||||
|
{
|
||||||
|
Name = "Whole device",
|
||||||
|
Length = image.ImageInfo.sectors,
|
||||||
|
Size = image.ImageInfo.sectors * image.ImageInfo.sectorSize
|
||||||
|
};
|
||||||
|
Assert.AreEqual(true, fs.Identify(image, wholePart), testfiles[i]);
|
||||||
|
fs.GetInformation(image, wholePart, out string information);
|
||||||
|
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
|
||||||
|
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
|
||||||
|
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
119
DiscImageChef.Tests/Filesystems/HTFS_MBR.cs
Normal file
119
DiscImageChef.Tests/Filesystems/HTFS_MBR.cs
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// The Disc Image Chef
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : SysV_MBR.cs
|
||||||
|
// Version : 1.0
|
||||||
|
// Author(s) : Natalia Portillo
|
||||||
|
//
|
||||||
|
// Component : Component
|
||||||
|
//
|
||||||
|
// Revision : $Revision$
|
||||||
|
// Last change by : $Author$
|
||||||
|
// Date : $Date$
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description
|
||||||
|
//
|
||||||
|
// --[ 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/>.
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2011-2015 Claunia.com
|
||||||
|
// ****************************************************************************/
|
||||||
|
// //$Id$
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using DiscImageChef.CommonTypes;
|
||||||
|
using DiscImageChef.DiscImages;
|
||||||
|
using DiscImageChef.Filesystems;
|
||||||
|
using DiscImageChef.Filters;
|
||||||
|
using DiscImageChef.ImagePlugins;
|
||||||
|
using DiscImageChef.PartPlugins;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Tests.Filesystems
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class HTFS_MBR
|
||||||
|
{
|
||||||
|
readonly string[] testfiles = {
|
||||||
|
"scoopenserver_5.0.7hw.vdi.lz"
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly ulong[] sectors = {
|
||||||
|
2097152,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly uint[] sectorsize = {
|
||||||
|
512,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly long[] clusters = {
|
||||||
|
1020096,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly int[] clustersize = {
|
||||||
|
1024,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumename = {
|
||||||
|
"Volume label",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumeserial = {
|
||||||
|
null,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] type = {
|
||||||
|
"HTFS",
|
||||||
|
};
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test()
|
||||||
|
{
|
||||||
|
for(int i = 0; i < testfiles.Length; i++)
|
||||||
|
{
|
||||||
|
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "htfs_mbr", testfiles[i]);
|
||||||
|
Filter filter = new LZip();
|
||||||
|
filter.Open(location);
|
||||||
|
ImagePlugin image = new VDI();
|
||||||
|
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
|
||||||
|
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
|
||||||
|
List<Partition> partitions = Core.Partitions.GetAll(image);
|
||||||
|
Filesystem fs = new DiscImageChef.Filesystems.SysVfs();
|
||||||
|
int part = -1;
|
||||||
|
for(int j = 0; j < partitions.Count; j++)
|
||||||
|
{
|
||||||
|
if(partitions[j].Type == "XENIX")
|
||||||
|
{
|
||||||
|
part = j;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i]));
|
||||||
|
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
|
||||||
|
fs.GetInformation(image, partitions[part], out string information);
|
||||||
|
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
|
||||||
|
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
|
||||||
|
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -49,38 +49,65 @@ namespace DiscImageChef.Tests.Filesystems
|
|||||||
{
|
{
|
||||||
readonly string[] testfiles = {
|
readonly string[] testfiles = {
|
||||||
"amix.adf.lz",
|
"amix.adf.lz",
|
||||||
|
"att_unix_svr4v2.1_dsdd.img.lz", "att_unix_svr4v2.1_mf2dd.img.lz", "att_unix_svr4v2.1_mf2hd.img.lz",
|
||||||
|
"scoopenserver_5.0.7hw_dmf.img.lz", "scoopenserver_5.0.7hw_dshd.img.lz", "scoopenserver_5.0.7hw_mf2dd.img.lz", "scoopenserver_5.0.7hw_mf2ed.img.lz",
|
||||||
|
"scoopenserver_5.0.7hw_mf2hd.img.lz",
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly MediaType[] mediatypes = {
|
readonly MediaType[] mediatypes = {
|
||||||
MediaType.CBM_AMIGA_35_DD,
|
MediaType.CBM_AMIGA_35_DD,
|
||||||
|
MediaType.DOS_525_DS_DD_9,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD,
|
||||||
|
MediaType.DMF,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,
|
||||||
|
MediaType.DOS_35_HD,
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly ulong[] sectors = {
|
readonly ulong[] sectors = {
|
||||||
1760,
|
1760,
|
||||||
|
720, 1440, 2880,
|
||||||
|
3360, 2400, 1440, 5760,
|
||||||
|
2880,
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly uint[] sectorsize = {
|
readonly uint[] sectorsize = {
|
||||||
512,
|
512,
|
||||||
|
512, 512, 512,
|
||||||
|
512, 512, 512, 512,
|
||||||
|
512,
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly long[] clusters = {
|
readonly long[] clusters = {
|
||||||
880,
|
880,
|
||||||
|
360, 720, 1440,
|
||||||
|
1680, 1200, 720, 2880,
|
||||||
|
1440,
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly int[] clustersize = {
|
readonly int[] clustersize = {
|
||||||
1024,
|
1024,
|
||||||
|
1024, 1024, 1024,
|
||||||
|
1024, 1024, 1024, 1024,
|
||||||
|
1024,
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly string[] volumename = {
|
readonly string[] volumename = {
|
||||||
"",
|
"",
|
||||||
|
"", "", "",
|
||||||
|
"", "", "", "",
|
||||||
|
"",
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly string[] volumeserial = {
|
readonly string[] volumeserial = {
|
||||||
null,
|
null,
|
||||||
|
null, null, null,
|
||||||
|
null, null, null, null,
|
||||||
|
null,
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly string[] type = {
|
readonly string[] type = {
|
||||||
"SVR2 fs",
|
"SVR2 fs",
|
||||||
|
"SVR4 fs", "SVR4 fs", "SVR4 fs",
|
||||||
|
"SVR4 fs", "SVR4 fs", "SVR4 fs", "SVR4 fs",
|
||||||
|
"SVR4 fs",
|
||||||
};
|
};
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|||||||
@@ -51,35 +51,35 @@ namespace DiscImageChef.Tests.Filesystems
|
|||||||
public class SysV_MBR
|
public class SysV_MBR
|
||||||
{
|
{
|
||||||
readonly string[] testfiles = {
|
readonly string[] testfiles = {
|
||||||
"xenix_2.3.2d.vdi.lz",
|
"att_unix_svr4v2.1.vdi.lz", "att_unix_svr4v2.1_2k.vdi.lz", "scoopenserver_5.0.7hw.vdi.lz"
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly ulong[] sectors = {
|
readonly ulong[] sectors = {
|
||||||
40960,40960,
|
1024000, 1024000, 2097152,
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly uint[] sectorsize = {
|
readonly uint[] sectorsize = {
|
||||||
512,512,
|
512, 512, 512,
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly long[] clusters = {
|
readonly long[] clusters = {
|
||||||
19624,19624,
|
511056, 255528, 1020096,
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly int[] clustersize = {
|
readonly int[] clustersize = {
|
||||||
1024,1024,
|
1024, 2048, 1024,
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly string[] volumename = {
|
readonly string[] volumename = {
|
||||||
"Volume label","Volume label",
|
"/usr3", "/usr3", "Volume label",
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly string[] volumeserial = {
|
readonly string[] volumeserial = {
|
||||||
null,null,
|
null, null, null,
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly string[] type = {
|
readonly string[] type = {
|
||||||
"XENIX fs","XENIX fs",
|
"SVR4 fs", "SVR2 fs", "SVR4 fs",
|
||||||
};
|
};
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -99,7 +99,7 @@ namespace DiscImageChef.Tests.Filesystems
|
|||||||
int part = -1;
|
int part = -1;
|
||||||
for(int j = 0; j < partitions.Count; j++)
|
for(int j = 0; j < partitions.Count; j++)
|
||||||
{
|
{
|
||||||
if(partitions[j].Type == "0x02")
|
if(partitions[j].Type == "UNIX: /usr" || partitions[j].Type == "XENIX")
|
||||||
{
|
{
|
||||||
part = j;
|
part = j;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ namespace DiscImageChef.Tests.Filesystems
|
|||||||
};
|
};
|
||||||
|
|
||||||
readonly string[] volumename = {
|
readonly string[] volumename = {
|
||||||
"Volume label",
|
"",
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly string[] volumeserial = {
|
readonly string[] volumeserial = {
|
||||||
@@ -79,7 +79,7 @@ namespace DiscImageChef.Tests.Filesystems
|
|||||||
};
|
};
|
||||||
|
|
||||||
readonly string[] type = {
|
readonly string[] type = {
|
||||||
"SVR4 fs",
|
"SVR2 fs",
|
||||||
};
|
};
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|||||||
126
DiscImageChef.Tests/Filesystems/XENIX.cs
Normal file
126
DiscImageChef.Tests/Filesystems/XENIX.cs
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// The Disc Image Chef
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : XENIX.cs
|
||||||
|
// Version : 1.0
|
||||||
|
// Author(s) : Natalia Portillo
|
||||||
|
//
|
||||||
|
// Component : Component
|
||||||
|
//
|
||||||
|
// Revision : $Revision$
|
||||||
|
// Last change by : $Author$
|
||||||
|
// Date : $Date$
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description
|
||||||
|
//
|
||||||
|
// --[ 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/>.
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2011-2015 Claunia.com
|
||||||
|
// ****************************************************************************/
|
||||||
|
// //$Id$
|
||||||
|
using System.IO;
|
||||||
|
using DiscImageChef.CommonTypes;
|
||||||
|
using DiscImageChef.Filesystems;
|
||||||
|
using DiscImageChef.Filters;
|
||||||
|
using DiscImageChef.ImagePlugins;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Tests.Filesystems
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class XENIX
|
||||||
|
{
|
||||||
|
readonly string[] testfiles = {
|
||||||
|
"scoopenserver_5.0.7hw_dmf.img.lz", "scoopenserver_5.0.7hw_dshd.img.lz", "scoopenserver_5.0.7hw_mf2dd.img.lz", "scoopenserver_5.0.7hw_mf2ed.img.lz",
|
||||||
|
"scoopenserver_5.0.7hw_mf2hd.img.lz",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly MediaType[] mediatypes = {
|
||||||
|
MediaType.DMF, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_ED,
|
||||||
|
MediaType.DOS_35_HD,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly ulong[] sectors = {
|
||||||
|
3360, 2400, 1440, 5760,
|
||||||
|
2880,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly uint[] sectorsize = {
|
||||||
|
512, 512, 512, 512,
|
||||||
|
512,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly long[] clusters = {
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
1680, 1200, 720, 2880,
|
||||||
|
1440,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly int[] clustersize = {
|
||||||
|
1024, 1024, 1024, 1024,
|
||||||
|
1024,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumename = {
|
||||||
|
"", "", "", "",
|
||||||
|
"",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumeserial = {
|
||||||
|
null, null, null, null,
|
||||||
|
null,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] type = {
|
||||||
|
"XENIX fs", "XENIX fs", "XENIX fs", "XENIX fs",
|
||||||
|
"XENIX fs",
|
||||||
|
};
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test()
|
||||||
|
{
|
||||||
|
for(int i = 0; i < testfiles.Length; i++)
|
||||||
|
{
|
||||||
|
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "xenix", testfiles[i]);
|
||||||
|
Filter filter = new LZip();
|
||||||
|
filter.Open(location);
|
||||||
|
ImagePlugin image = new ZZZRawImage();
|
||||||
|
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
|
||||||
|
Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
|
||||||
|
Filesystem fs = new DiscImageChef.Filesystems.SysVfs();
|
||||||
|
Partition wholePart = new Partition
|
||||||
|
{
|
||||||
|
Name = "Whole device",
|
||||||
|
Length = image.ImageInfo.sectors,
|
||||||
|
Size = image.ImageInfo.sectors * image.ImageInfo.sectorSize
|
||||||
|
};
|
||||||
|
Assert.AreEqual(true, fs.Identify(image, wholePart), testfiles[i]);
|
||||||
|
fs.GetInformation(image, wholePart, out string information);
|
||||||
|
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
|
||||||
|
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
|
||||||
|
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
DiscImageChef.Tests/Filesystems/XENIX_MBR.cs
Normal file
120
DiscImageChef.Tests/Filesystems/XENIX_MBR.cs
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// The Disc Image Chef
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : SysV_MBR.cs
|
||||||
|
// Version : 1.0
|
||||||
|
// Author(s) : Natalia Portillo
|
||||||
|
//
|
||||||
|
// Component : Component
|
||||||
|
//
|
||||||
|
// Revision : $Revision$
|
||||||
|
// Last change by : $Author$
|
||||||
|
// Date : $Date$
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Description
|
||||||
|
//
|
||||||
|
// --[ 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/>.
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2011-2015 Claunia.com
|
||||||
|
// ****************************************************************************/
|
||||||
|
// //$Id$
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using DiscImageChef.CommonTypes;
|
||||||
|
using DiscImageChef.DiscImages;
|
||||||
|
using DiscImageChef.Filesystems;
|
||||||
|
using DiscImageChef.Filters;
|
||||||
|
using DiscImageChef.ImagePlugins;
|
||||||
|
using DiscImageChef.PartPlugins;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Tests.Filesystems
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class XENIX_MBR
|
||||||
|
{
|
||||||
|
readonly string[] testfiles = {
|
||||||
|
"xenix_2.3.2d.vdi.lz", "xenix_2.3.4h.vdi.lz", "scoopenserver_5.0.7hw.vdi.lz",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly ulong[] sectors = {
|
||||||
|
40960, 40960, 2097152,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly uint[] sectorsize = {
|
||||||
|
512, 512, 512,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly long[] clusters = {
|
||||||
|
0, 0, 0,
|
||||||
|
19624, 19624, 19624,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly int[] clustersize = {
|
||||||
|
1024, 1024, 1024,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumename = {
|
||||||
|
"", "", "",
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] volumeserial = {
|
||||||
|
null, null, null,
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly string[] type = {
|
||||||
|
"XENIX fs", "XENIX fs", "XENIX fs",
|
||||||
|
};
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test()
|
||||||
|
{
|
||||||
|
for(int i = 0; i < testfiles.Length; i++)
|
||||||
|
{
|
||||||
|
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "xenix_mbr", testfiles[i]);
|
||||||
|
Filter filter = new LZip();
|
||||||
|
filter.Open(location);
|
||||||
|
ImagePlugin image = new VDI();
|
||||||
|
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
|
||||||
|
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
|
||||||
|
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
|
||||||
|
List<Partition> partitions = Core.Partitions.GetAll(image);
|
||||||
|
Filesystem fs = new DiscImageChef.Filesystems.SysVfs();
|
||||||
|
int part = -1;
|
||||||
|
for(int j = 0; j < partitions.Count; j++)
|
||||||
|
{
|
||||||
|
if(partitions[j].Type == "XENIX")
|
||||||
|
{
|
||||||
|
part = j;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i]));
|
||||||
|
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
|
||||||
|
fs.GetInformation(image, partitions[part], out string information);
|
||||||
|
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
|
||||||
|
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
|
||||||
|
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||||
|
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user