Exemple #1
0
 public static void GetDebianPlatform(Linux obj, string unitTestContent)
 {
     //Version list available at: http://www.debian.org/releases/
     //There is no accurate way to determine the version information
     //in Debian. The community mixes the versions regularly and
     //argues that programs should not rely on this information,
     //instead using the dependencies to determine if a program will
     //work. Unfortunately, this viewpoint does little for generic
     //informational purposes, version based bug reporting, etc. They
     //have not standardized this process, even for the
     //lsb_release package. The information provided in
     // /etc/debian_version is often incorrect and should not be used.
     obj.ClassName       = "Linux.Debian";
     obj.PlatformSubType = "Debian";
     obj.Edition         = "";
     obj.Version         = "";
 }
Exemple #2
0
        public static void GetGentooPlatform(Linux obj, string unitTestContent)
        {
            //Version list available at http://gentest.neysx.org/proj/en/releng/#doc_chap6
            //Versioning is primarily based on date.
            //Unique version variations for parsing include:
            //		Gentoo Base System release 1.12.11.1

            List <string> lines;

            if (unitTestContent != null)
            {
                lines = ParseString(unitTestContent);
            }
            else
            {
                lines = ParseFile(obj.VersionFile);
            }

            obj.ClassName       = "Linux.Gentoo";
            obj.PlatformSubType = "Gentoo";
            obj.Edition         = "";
            obj.Version         = lines[0].Split().Last();
        }
Exemple #3
0
        public static void GetSlackwarePlatform(Linux obj, string unitTestContent)
        {
            //Version list is available at ...
            //Unique version variations for parsing include:
            //		Slackware 13.0.0.0.0

            List <string> lines;

            if (unitTestContent != null)
            {
                lines = ParseString(unitTestContent);
            }
            else
            {
                lines = ParseFile("/etc/" + obj.VersionFile);
            }

            obj.ClassName       = "Linux.Slackware";
            obj.PlatformSubType = "Slackware";
            obj.Edition         = "";
            int pt = lines[0].IndexOf(" ");

            obj.Version = lines[0].Substring(pt + 1, lines[0].Length - 1);
        }
Exemple #4
0
 public static void GetUbuntuPlatform(Linux obj)
 {
     GetUbuntuPlatform(obj, null);
 }
Exemple #5
0
 public static void GetSusePlatform(Linux obj)
 {
     GetSusePlatform(obj, null);
 }
Exemple #6
0
        public static void GetMandrivaPlatform(Linux obj, string unitTestContent)
        {
            //Formerly known as Mandrake Linux
            //Version list is available at http://en.wikipedia.org/wiki/Mandriva_Linux
            //Unique version variations for parsing include:
            //		Mandriva Linux release 2010.0 (Official) for i586

            List <string> lines;

            if (unitTestContent != null)
            {
                lines = ParseString(unitTestContent);
            }
            else
            {
                lines = ParseFile("/etc/" + obj.VersionFile);
            }

            obj.ClassName       = "Linux.Mandriva";
            obj.PlatformSubType = "Mandriva";
            obj.Edition         = "";
            int pt  = lines[0].IndexOf("release");
            int pt2 = lines[0].IndexOf("(");

            obj.Version = lines[0].Substring(pt + 8, pt2 - 1).Trim();

            switch (obj.Version)
            {
            case "2010.0":
                obj.Edition = "Mandriva Linux 2010";
                break;

            case "2009.1":
                obj.Edition = "Mandriva Linux 2009 Spring";
                break;

            case "2009.0":
                obj.Edition = "Mandriva Linux 2009";
                break;

            case "2008.1":
                obj.Edition = "Mandriva Linux 2008 Spring";
                break;

            case "2008.0":
                obj.Edition = "Mandriva Linux 2008";
                break;

            case "2007.1":
                obj.Edition = "Mandriva Linux 2007 Spring";
                break;

            case "2007":
                obj.Edition = "Mandriva Linux 2007";
                break;

            case "2006.0":
                obj.Edition = "Mandriva Linux 2006";
                break;

            case "10.2":
                obj.Edition = "Limited Edition 2005";
                break;

            case "10.1":
                obj.Edition = "Community and Official";
                break;

            case "10.0":
                obj.Edition = "Community and Official";
                break;

            case "9.2":
                obj.Edition = "FiveStar";
                break;

            case "9.1":
                obj.Edition = "Bamboo";
                break;

            case "9.0":
                obj.Edition = "Dolphin";
                break;

            case "8.2":
                obj.Edition = "Bluebird";
                break;

            case "8.1":
                obj.Edition = "Vitamin";
                break;

            case "8.0":
                obj.Edition = "Traktopel";
                break;

            case "7.2":
                obj.Edition = "Odyssey";
                break;

            case "7.1":
                obj.Edition = "Helium";
                break;

            case "7.0":
                obj.Edition = "Air";
                break;

            case "6.1":
                obj.Edition = "Helios";
                break;

            case "6.0":
                obj.Edition = "Venus";
                break;

            case "5.3":
                obj.Edition = "Festen";
                break;

            case "5.2":
                obj.Edition = "Leeloo";
                break;

            case "5.1":
                obj.Edition = "Venice";
                break;

            default:
                obj.Edition = "Unknown";
                break;
            }
        }