Exemple #1
0
        public void ProcessMLAPI()
        {
            string        inputname;
            string        inputdate;
            string        inputverdict;
            string        inputversion;
            int           modifycount = 0;
            List <string> filecontent = new List <string>();

            if (TCR.EndsWith(".sig"))
            {
                //do nothing
            }
            else
            {
                try
                {
                    filecontent = File.ReadAllLines(TCR).ToList <string>();       //create list to put each line into it
                }
                catch
                {
                    return;
                }
                for (int x = 0; x < filecontent.Count; x++)
                {
                    if (filecontent[x].Contains("TCR_TestCaseReport name"))                     //go through list to find values and put them in
                    {
                        string[] temp = filecontent[x].Split('=');
                        inputname = temp[1];
                        inputname = inputname.Substring(1, inputname.Length - 3);
                        string firstletter = inputname.Substring(0, 1);
                        if (firstletter != "I")
                        {
                            {
                                if (inputname.Length > 22)
                                {
                                    Name.Add(inputname.Substring(0, 22));
                                }
                                else
                                {
                                    Name.Add(inputname);
                                }
                            }
                        }
                    }
                    if (filecontent[x].Contains("TCR_ExecutionDate value"))
                    {
                        string[] temp = filecontent[x].Split('=');
                        inputdate = temp[1];
                        inputdate = inputdate.Substring(1, inputdate.Length - 4);
                        if (inputdate.Length > 10)
                        {
                            Date.Add(inputdate.Substring(0, inputdate.Length - 1));
                        }
                        else
                        {
                            Date.Add(inputdate);
                        }
                    }
                    if (filecontent[x].Contains("TCR_Verdict value"))
                    {
                        string[] temp = filecontent[x].Split('=');
                        inputverdict = temp[1];
                        inputverdict = inputverdict.Substring(1, inputverdict.Length - 4);
                        if (inputverdict.Length > 4)
                        {
                            Verdict.Add(inputverdict.Substring(0, inputverdict.Length - 1));
                        }
                        else
                        {
                            Verdict.Add(inputverdict);
                        }
                    }
                    if (filecontent[x].Contains("NOT VALID for UE certification"))
                    {
                        modifycount = modifycount | 1;
                    }
                    if (filecontent[x].Contains("ENGINEERING BuildID"))
                    {
                        modifycount = modifycount | 2;
                    }
                    if (modifycount == 1 || modifycount == 3)
                    {
                        Modify.Add("MODIFIED");
                    }
                    else
                    {
                        Modify.Add(" ");
                    }
                    if (filecontent[x].Contains("NTT DOCOMO DST"))
                    {
                        int      index   = filecontent[x].IndexOf("NTT DOCOMO DST");
                        string   removed = filecontent[x].Remove(0, index);
                        string[] nospace = removed.Split(' ');
                        inputversion = nospace[3];
                        inputversion = inputversion.Remove(0, 1);
                        if (string.IsNullOrEmpty(detail.Version))
                        {
                            Version.Add(inputversion);
                        }
                        else if (detail.Version == inputversion)
                        {
                            Version.Add("");
                        }
                        else
                        {
                            Version.Add("NG");
                        }
                    }
                }
            }
            if (!string.IsNullOrEmpty(Sig))
            {
                SignatureVerifier versig = new SignatureVerifier(Sig);
                bool valid = versig.cmdverify();

                if (valid)
                {
                    Signature.Add("VALID");
                }
                else
                {
                    Signature.Add("INVALID");
                }
            }
        }
Exemple #2
0
        public void ProcessTTCN()
        {
            string        verdictcheck = "NONE";
            string        inputdate;
            string        inputverdict;
            string        inputversion;
            int           modifycount = 0;
            List <string> filecontent = new List <string>();

            try
            {
                filecontent = File.ReadAllLines(TCR).ToList <string>();        //create list and put each line into it
            }
            catch
            {
                return;
            }
            for (int i = 0; i < filecontent.Count; i++)
            {
                if (filecontent[i].Contains("NOT VALID for UE certification"))              //search through list for all the given values
                {
                    modifycount = modifycount | 1;
                }
                if (filecontent[i].Contains("NTT docomo DST"))
                {
                    int      index   = filecontent[i].IndexOf("NTT docomo DST");
                    string   removed = filecontent[i].Remove(0, index);
                    string[] nospace = removed.Split(' ');
                    inputversion = nospace[3];
                    inputversion = inputversion.Remove(0, 1);
                    if (string.IsNullOrEmpty(detail.Version))
                    {
                        Version.Add(inputversion);
                    }
                    else if (detail.Version.Contains(inputversion))
                    {
                        Version.Add("");
                    }
                    else
                    {
                        Version.Add("NG");
                    }
                }
                if (filecontent[i].Contains("Final Verdict: PASS"))
                {
                    verdictcheck = "PASS";
                }
                else if (filecontent[i].Contains("Final Verdict: FAIL"))
                {
                    verdictcheck = "FAIL";
                }
                else if (filecontent[i].Contains("Final Verdict: INCONC"))
                {
                    verdictcheck = "INCONC";
                }
            }
            try
            {
                filecontent = File.ReadAllLines(Summary).ToList <string>();
            }
            catch
            {
                return;
            }
            for (int x = 0; x < filecontent.Count; x++)
            {
                if (filecontent[x].Contains("Test:"))
                {
                    string[] temp = filecontent[x].Split('.');
                    Name.Add(temp[temp.Length - 1]);
                    int listlength = Name.Count;
                }
                if (filecontent[x].Contains("Result:"))
                {
                    string[] temp = filecontent[x].Split(':');
                    inputverdict = temp[temp.Length - 1].Trim();
                    if (verdictcheck != "")
                    {
                        if (inputverdict.Contains("PASS") && !verdictcheck.Contains("PASS"))
                        {
                            Verdict.Add("NONE");
                        }
                        else
                        {
                            Verdict.Add(inputverdict);
                        }
                    }
                    else
                    {
                        Verdict.Add(inputverdict);
                    }
                }
                if (filecontent[x].Contains("Date:"))
                {
                    if (filecontent[x].Contains('/'))
                    {
                        string[] temp = filecontent[x].Split(':');
                        inputdate = temp[temp.Length - 1].Trim();
                        temp      = inputdate.Split('/');
                        inputdate = temp[2] + '-' + temp[0] + '-' + temp[1];
                        Date.Add(inputdate);
                    }
                }
                if (filecontent[x].Contains("Invalid for UE certification"))
                {
                    modifycount = modifycount | 1;
                }
                if (filecontent[x].Contains("ENGINEERING"))
                {
                    modifycount = modifycount | 2;
                }
            }

            if (modifycount == 1 || modifycount == 3)
            {
                Modify.Add("MODIFIED");
            }
            else
            {
                Modify.Add(" ");
            }

            if (!string.IsNullOrEmpty(Sig))
            {
                SignatureVerifier versig = new SignatureVerifier(Sig);
                bool valid = versig.cmdverify();

                if (valid)
                {
                    Signature.Add("VALID");
                }
                else
                {
                    Signature.Add("INVALID");
                }
            }
        }