How to find all routes that are going out an interface in IOS-XR.
Hi all,
So if I have the following set up in IOS:
interface GigabitEthernet7/0/0.265
encapsulation dot1Q 265
ip vrf forwarding test
ip address 1.1.1.1 255.255.255.252
ip verify unicast reverse-path
end
ip route vrf Apollo 2.2.2.0 255.255.255.248 1.1.1.2
I can see all the routes that are going out the interface using show ip cef command:
ios-router#show ip cef vrf test GigabitEthernet7/0/0.265
2.2.2.0/29
nexthop 1.1.1.2 GigabitEthernet7/0/0.265
1.1.1.0/30
attached to GigabitEthernet7/0/0.265
1.1.1.2/32
attached to GigabitEthernet7/0/0.265
In case of IOS-XR (ASR9K 4.3.2 or 4.3.1) the same setup and command shows only
attached routes:
router static
vrf test
address-family ipv4 unicast
2.2.2.0/29 1.1.1.2
RP/0/RSP0/CPU0:TST_riga-sb7-pe-asr9#show cef vrf test bundle-ether2.265
Prefix Next Hop Interface
1.1.1.0/30 attached Bundle-Ether2.2220333
1.1.1.0/32 broadcast Bundle-Ether2.2220333
1.1.1.1/32 receive Bundle-Ether2.2220333
1.1.1.2/32 1.1.1.2 Bundle-Ether2.2220333
1.1.1.3/32 broadcast Bundle-Ether2.2220333
Is there any command to see all the routes that are going out an interface without complicated parsing
of the configuration, recursive show cef commands etc.?
You can accomplish this with the "show route" command. Here is an example:
P/0/RSP1/CPU0:ASR9006-E#sh route next-hop tenGigE 0/3/0/2
Tue Oct 8 15:34:58.046 UTC
Codes: C - connected, S - static, R - RIP, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - ISIS, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, su - IS-IS summary null, * - candidate default
U - per-user static route, o - ODR, L - local, G - DAGR
A - access/subscriber, - FRR Backup path
Gateway of last resort is 172.18.87.1 to network 0.0.0.0
D 10.95.248.1/32 [90/128512] via 10.129.56.210, 4d00h, TenGigE0/3/0/2
C 10.129.56.208/30 is directly connected, 4d00h, TenGigE0/3/0/2
L 10.129.56.209/32 is directly connected, 4d00h, TenGigE0/3/0/2
O 10.242.142.240/30 [110/20] via 10.129.56.210, 3d11h, TenGigE0/3/0/2
[110/20] via 10.129.56.214, 3d11h, TenGigE0/3/0/3
D 192.168.1.16/32 [90/128512] via 10.129.56.210, 4d00h, TenGigE0/3/0/2
D 192.168.20.39/32 [90/128512] via 10.129.56.210, 4d00h, TenGigE0/3/0/2
RP/0/RSP1/CPU0:ASR9006-E#
Thanks,
Bryan
Similar Messages
-
How to find all tables that are associated with a given domain name.
I want to find all table, excluding the structures, of a given domain name, say, waers.
Some of the tables are directly contains the domains while others are related with a data element which is connected to that domain.
I want to find tables for all two case -either tables connected directly to the domain or connected via data element- and exclude the structures.
thanks in advance.Hi,
The following thing may help you.
in se11-> search for tables having names like 'DD*'.
From this list of tables you can find the required table to get domain, data element nad table name.
one way of doing it:
SELECT rollname domname
FROM dd04l
INTO CORRESPONDING FIELDS OF TABLE it_tab.
SELECT rollname tabname
FROM dd03l
INTO CORRESPONDING FIELDS OF TABLE it_tab1
FOR ALL ENTRIES IN it_tab
WHERE rollname = it_tab-rollname.
SORT it_tab1.
DELETE ADJACENT DUPLICATES FROM it_tab1.
LOOP AT it_tab1 INTO wa_tab.
MODIFY it_tab FROM wa_tab
TRANSPORTING tabname
WHERE rollname = wa_tab-rollname.
ENDLOOP.
LOOP AT it_tab INTO wa_tab.
WRITE:/ wa_tab-domname,
wa_tab-tabname.
ENDLOOP.
Regards,
Manoj Kumar P -
How to see all devices that are connected to Apple ID
How to see all devices that are connected to Apple ID
Are you using a software to see all devices that are supposed to be connected to your router? You can reset and start over with your router. Make sure you have a security enabled on it like WPA Personal. You can try DHCP Reservation as well to ensure that the devices that will have access to your router are only the ones you included on the list.
-
How do I open documents that are grayed out?
How do I open documents that are grayed out?
Do these files have a file extension (e.g. .dmg, .jpg, etc.)?
Clinton
MacBook Pro (15” Late 2011), OS X Yosemite 10.10, 16GB Crucial RAM, 960GB M500 Crucial SSD, 27” Apple Thunderbolt Display -
How to log all messages that are in JtextArea
Hi all
how would i log all message that are in the JTextArea????
i know of java.util.logging but cant find any usefull tutorials on them.......can someone show me the way to go!
Thanks
DilipYeah dude, I could. But what would that accomplish? Oh sure, that may be some cultural pressure; you know, help out a Hindu-bhai kinda thing, but nah... My giving you the answer won't serve to help you in the long run.
Ask yourself a couple of questions. Shall I log the information simultaneously (to the JTextArea and the file) or shall I write all the information to the text area first and then to the log file? Is the information in the log fle going to be different than that in the JTextArea because, for example, it is needed for audit purposes?
I hope I stimulated you think more about the requirements and possible solutions. -
How to find all photos that have NO faces, as opposed to UNNAMED faces?
I find that iPhoto often misses faces entirely, especially if the face is wearing sunglasses or a hat or both. Sometimes it is rather inexplicable that it has missed a face, as the face seems obvious.
If you use the smart album method to find all "unnamed" faces, the photos have at least one unnamed face identified. You can then add any missed faces to those photos.
But what about photos in which iPhoto has failed to identify the existence of even one face? Or for that matter, if I want to see only pictures of landscapes or objects that have no people? Does anyone have a method for finding all photos that have no faces in them at all?
For me, the idea is to find all unidentified faces and add them. But as I pointed out above, there may be other uses for this.
Any ideas, anyone?
ThanksAwesome !!! Thank you very much. I did not realize you could use JavaScript to code against iTunes ...
I don't know if you have written any of these yourself, but do you know how to maybe create a smart playlist with this information via script? If not, no big deal. At least I know have something which I can use, I will just have to run it every so often.
Thanks again for pointing me to that site! -
How to list all calendars that are shared to a specific user?
Hi,
Using Exchange Management Shell/Powershell, I want to list all calendars that are shared to a specific user 'myuser'.
I have tried different approaches; list all calendars for all users and then figure out which ones are shared to 'myuser', list all mailboxfolders for 'myuser' with path 'calendar' and sort out the shared ones, ... No luck so far.
Anybody?
babuHi
If you try this command:
Get-MailboxPermission MyUser -
How to find the urls that are longer than 260 characters
Hi
I'm getting an error using Restore-SPSite thats most likely caused by URL's longer than 260 characters. How can I find out which URL's are too long? It's a huge site collection so it's not an option to search manually.
Regards
Jakobcheck this blog, allows you to take an inventory of all files in your web application and flag those files where the path (or URL) is longer than 260 characters.
Locating files and pages with URLs that are too long for SharePoint
Also check this: http://social.technet.microsoft.com/Forums/en-US/881d62e6-08c3-43b6-a9f1-96161ffa0201/how-to-write-a-powershell-script-to-find-the-url-path-length-of-all-the-files-and-folders-in?forum=sharepointdevelopmentprevious
Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog -
How to get all rows that are returned in inner sub query of select statemen
If a sub query in select statement returns more than one row than how to get all those returned rows in the final
output of the query .It will be all right if all column's value repeat and that multiple output of inner query comes
in another column .
How to get that ?As Frank said, you likely want a join, and likely an outer join to replicate the select in the projection. Something like:
SELECT id,stat, section, USER_ID concerned_person
FROM table_all,
left join table2
on room_id = sectoion and
sur_role = 'r001'
WHERE section IN (SELECT code
FROM t_area
WHERE dept= 'p002')An alternative, depending on where and how you are using the statement would be something like:
SQL> WITH t AS (
2 select 1 id from dual union all
3 select 2 id from dual),
4 t1 as (
5 select 1 id, 'One' descr from dual union all
6 select 1, 'Un' from dual union all
7 select 1, 'Une' from dual)
8 SELECT t.id, CURSOR(SELECT t1.id, t1.descr from t1
9 WHERE t1.id = t.id)
10 FROM t;
ID CURSOR(SELECTT1.ID,T
1 CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
ID DESCR
1 One
1 Un
1 Une
2 CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
no rows selectedJohn -
How to find all songs that do not have album art
I create several smart playlists for housekeeping, like songs with no year, songs with no album name, etc. I wanted to create a similar one that lists all songs that do not have any album art associated with it. I have not seen this option when creating a playlist, but I didn't know if there was a way to write a script (that could run on Windows) that could create this playlist for me. I can (and have) gone through each song individually to note which did not have album art, but I have almost 5000 songs, and this is not really feasible any more.
Has anyone else done anything similar to this? Any suggestions are greatly appreciated.Awesome !!! Thank you very much. I did not realize you could use JavaScript to code against iTunes ...
I don't know if you have written any of these yourself, but do you know how to maybe create a smart playlist with this information via script? If not, no big deal. At least I know have something which I can use, I will just have to run it every so often.
Thanks again for pointing me to that site! -
SQL query to find all suites that are associated with automation
I trying to incorporate CodeUI tests into a Release Mangement deployment template ... As a developer, I want to be able to specify a sub-tree of a test plan & only execute those test suites that are associated with automation. Is there a way to
extract all automated workitems and associated them with their respective test suites?
Any assistance would be greatly appreciated!John,
I've partially resolved the issue of executing a sub-set of suites with the following powershell implementation:
1. Extract "potential" suite paths from a XML configuration file:
<?xml version="1.0"?>
<Configurations>
<Properties>
<Property key="DEFAULT" value="SuitePaths" />
<Property key="DatabaseServer" value="MYDBSERVER" />
<Property key="DatabaseInstance" value="Default" />
<Property key="DatabaseName" value="TFS_DefaultCollection" />
<Property key="ConfigurationName" value="US - Windows 7 and IE 10" />
</Properties>
<Notifications>
<Notification key="0" value="[email protected]" />
</Notifications>
<SuitePaths>
<SuitePath key="0" value="MyProject\WebProduct\Student\Features\Login" />
<SuitePath key="1" value="MyProject\WebProduct\Student\Features\Logout" />
</SuitePaths>
<AreaPaths>
<AreaPath key="0" value="MyProject\WebProduct\Student\Features\Login" />
</AreaPaths>
</Configurations>
2. Extract record set of suites from TFS via SQL query:
# FUNCTION: Retrieve-SuitePaths
# Parameters:
# (1.) LogFile -- Name of log file (e.g., C:\Temp or C:\Temp\DEPLOY_DatabaseServer_WebCMS2_DF06_20131031.6.log)
# (2.) Connection -- Database connection
# (3.) Paths -- Hash table of suite paths
Function Retrieve-SuitePaths
param
[Parameter(Mandatory=$True)][String]$LogFile,
[Parameter(Mandatory=$True)]$Connection,
[Parameter(Mandatory=$True)]$Paths
Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
Write-Output "Retrieve suite(s): " | Out-File -FilePath $LogFile -Append
Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
$SuitePaths = "("
$Counter = 0
foreach ($Key in $Paths.Keys)
if ($Counter -gt 0)
$SuitePaths = $SuitePaths + ", "
$SuitePaths = $SuitePaths + "'" + $Paths.Get_Item($Key) + "'"
$Counter += 1
$SuitePaths = $SuitePaths + ")"
# --DEBUG ONLY--> Write-Output "Paths: $SuitePaths" | Out-File -FilePath $LogFile -Append
$Command = New-Object System.Data.SqlClient.SqlCommand
$SQLStatement = "
WITH
cte_SuiteChildren
AS
-- Anchor definition to pull all certify modes
SELECT
S.[SuiteId],
S.[ProjectId],
PJ.ProjectName,
S.[PlanId],
P.[Name] AS PlanName,
S.[ParentSuiteId],
S.[SuitePath],
CONVERT(NVARCHAR(256), NULL) AS ParentTitle,
S.[Title],
0 AS RecurseLevel
FROM
[dbo].[tbl_Suite] AS S
INNER JOIN [dbo].[tbl_Plan] AS P ON S.PlanID = P.PlanID
INNER JOIN [dbo].[tbl_Project] AS PJ ON S.ProjectID = PJ.ProjectID
WHERE
S.ParentSuiteID = 0
UNION ALL
-- Recursive member to pull details of certify sessions
SELECT
S.[SuiteId],
S.[ProjectId],
PJ.ProjectName,
S.[PlanId],
P.[Name] AS PlanName,
S.[ParentSuiteId],
S.[SuitePath],
PS.[Title] AS ParentTitle,
S.[Title],
SC.[RecurseLevel] + 1 AS RecurseLevel
FROM
[dbo].[tbl_Suite] AS S
INNER JOIN cte_SuiteChildren AS SC on SC.SuiteID = S.ParentSuiteID
INNER JOIN [dbo].[tbl_Suite] AS PS ON SC.SuiteId = PS.SuiteId
INNER JOIN [dbo].[tbl_Plan] AS P ON S.PlanID = P.PlanID
INNER JOIN [dbo].[tbl_Project] AS PJ ON S.ProjectID = PJ.ProjectID
cte_SuiteLevel_0
AS
SELECT
SC.[ProjectId],
SC.[PlanId],
SC.[SuiteId],
SC.[ProjectName],
SC.[PlanName],
SC.[Title],
SC.[ProjectName] + '\' + SC.[PlanName] AS Path,
SC.[RecurseLevel]
FROM
cte_SuiteChildren AS SC
WHERE
SC.[RecurseLevel] = 0
cte_SuiteLevel_1
AS
SELECT
SC.[ProjectId],
SC.[PlanId],
SC.[ParentSuiteId],
SC.[SuiteId],
SC.[ProjectName],
SC.[PlanName],
SC.[Title],
SC.[RecurseLevel]
FROM
cte_SuiteChildren AS SC
WHERE
SC.[RecurseLevel] = 1
cte_SuiteLevel_2
AS
SELECT
SC.[ProjectId],
SC.[PlanId],
SC.[ParentSuiteId],
SC.[SuiteId],
SC.[ProjectName],
SC.[PlanName],
SC.[Title],
SC.[RecurseLevel]
FROM
cte_SuiteChildren AS SC
WHERE
SC.[RecurseLevel] = 2
cte_SuiteLevel_3
AS
SELECT
SC.[ProjectId],
SC.[PlanId],
SC.[ParentSuiteId],
SC.[SuiteId],
SC.[ProjectName],
SC.[PlanName],
SC.[Title],
SC.[RecurseLevel]
FROM
cte_SuiteChildren AS SC
WHERE
SC.[RecurseLevel] = 3
cte_SuiteLevel_4
AS
SELECT
SC.[ProjectId],
SC.[PlanId],
SC.[ParentSuiteId],
SC.[SuiteId],
SC.[ProjectName],
SC.[PlanName],
SC.[Title],
SC.[RecurseLevel]
FROM
cte_SuiteChildren AS SC
WHERE
SC.[RecurseLevel] = 4
cte_SuiteLevel_5
AS
SELECT
SC.[ProjectId],
SC.[PlanId],
SC.[ParentSuiteId],
SC.[SuiteId],
SC.[ProjectName],
SC.[PlanName],
SC.[Title],
SC.[RecurseLevel]
FROM
cte_SuiteChildren AS SC
WHERE
SC.[RecurseLevel] = 5
cte_SuiteLevel_6
AS
SELECT
SC.[ProjectId],
SC.[PlanId],
SC.[ParentSuiteId],
SC.[SuiteId],
SC.[ProjectName],
SC.[PlanName],
SC.[Title],
SC.[RecurseLevel]
FROM
cte_SuiteChildren AS SC
WHERE
SC.[RecurseLevel] = 6
cte_SuiteLevel_7
AS
SELECT
SC.[ProjectId],
SC.[PlanId],
SC.[ParentSuiteId],
SC.[SuiteId],
SC.[ProjectName],
SC.[PlanName],
SC.[Title],
SC.[RecurseLevel]
FROM
cte_SuiteChildren AS SC
WHERE
SC.[RecurseLevel] = 7
cte_SuiteLevel_8
AS
SELECT
SC.[ProjectId],
SC.[PlanId],
SC.[ParentSuiteId],
SC.[SuiteId],
SC.[ProjectName],
SC.[PlanName],
SC.[Title],
SC.[RecurseLevel]
FROM
cte_SuiteChildren AS SC
WHERE
SC.[RecurseLevel] = 8
cte_SuiteLevel_9
AS
SELECT
SC.[ProjectId],
SC.[PlanId],
SC.[ParentSuiteId],
SC.[SuiteId],
SC.[ProjectName],
SC.[PlanName],
SC.[Title],
SC.[RecurseLevel]
FROM
cte_SuiteChildren AS SC
WHERE
SC.[RecurseLevel] = 9
cte_SuiteLevel_10
AS
SELECT
SC.[ProjectId],
SC.[PlanId],
SC.[ParentSuiteId],
SC.[SuiteId],
SC.[ProjectName],
SC.[PlanName],
SC.[Title],
SC.[RecurseLevel]
FROM
cte_SuiteChildren AS SC
WHERE
SC.[RecurseLevel] = 10
cte_Suites
AS
SELECT
SL0.[ProjectId],
SL0.[PlanId],
CASE
WHEN SL2.ParentSuiteId IS NULL
THEN SL1.ParentSuiteId
ELSE CASE
WHEN SL3.ParentSuiteId IS NULL
THEN SL2.ParentSuiteId
ELSE CASE
WHEN SL4.ParentSuiteId IS NULL
THEN SL3.ParentSuiteId
ELSE CASE
WHEN SL5.ParentSuiteId IS NULL
THEN SL4.ParentSuiteId
ELSE CASE
WHEN SL6.ParentSuiteId IS NULL
THEN SL5.ParentSuiteId
ELSE CASE
WHEN SL7.ParentSuiteId IS NULL
THEN SL6.ParentSuiteId
ELSE CASE
WHEN SL8.ParentSuiteId IS NULL
THEN SL7.ParentSuiteId
ELSE CASE
WHEN SL9.ParentSuiteId IS NULL
THEN SL8.ParentSuiteId
ELSE CASE
WHEN SL10.ParentSuiteId IS NULL
THEN SL9.ParentSuiteId
ELSE SL10.ParentSuiteId
END
END
END
END
END
END
END
END
END AS [ParentSuiteId],
CASE
WHEN SL2.SuiteId IS NULL
THEN SL1.SuiteId
ELSE CASE
WHEN SL3.SuiteId IS NULL
THEN SL2.SuiteId
ELSE CASE
WHEN SL4.SuiteId IS NULL
THEN SL3.SuiteId
ELSE CASE
WHEN SL5.SuiteId IS NULL
THEN SL4.SuiteId
ELSE CASE
WHEN SL6.SuiteId IS NULL
THEN SL5.SuiteId
ELSE CASE
WHEN SL7.SuiteId IS NULL
THEN SL6.SuiteId
ELSE CASE
WHEN SL8.SuiteId IS NULL
THEN SL7.SuiteId
ELSE CASE
WHEN SL9.SuiteId IS NULL
THEN SL8.SuiteId
ELSE CASE
WHEN SL10.SuiteId IS NULL
THEN SL9.SuiteId
ELSE SL10.SuiteId
END
END
END
END
END
END
END
END
END AS [SuiteId],
SL0.ProjectName,
SL0.PlanName,
--SL0.Path,
--SL1.[Title],
CASE
WHEN SL2.Title IS NULL
THEN SL0.Path + '\' + SL1.Title
ELSE CASE
WHEN SL3.Title IS NULL
THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title
ELSE CASE
WHEN SL4.Title IS NULL
THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title
ELSE CASE
WHEN SL5.Title IS NULL
THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title + '\' + SL4.Title
ELSE CASE
WHEN SL6.Title IS NULL
THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title + '\' + SL4.Title + '\' + SL5.Title
ELSE CASE
WHEN SL7.Title IS NULL
THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title + '\' + SL4.Title + '\' + SL5.Title + '\' + SL6.Title
ELSE CASE
WHEN SL8.Title IS NULL
THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title + '\' + SL4.Title + '\' + SL5.Title + '\' + SL6.Title + '\' + SL7.Title
ELSE CASE
WHEN SL9.Title IS NULL
THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title + '\' + SL4.Title + '\' + SL5.Title + '\' + SL6.Title + '\' + SL7.Title + '\' + SL8.Title
ELSE CASE
WHEN SL10.Title IS NULL
THEN SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title + '\' + SL4.Title + '\' + SL5.Title + '\' + SL6.Title + '\' + SL7.Title + '\' + SL8.Title + '\' + SL9.Title
ELSE SL0.Path + '\' + SL1.Title + '\' + SL2.Title + '\' + SL3.Title + '\' + SL4.Title + '\' + SL5.Title + '\' + SL6.Title + '\' + SL7.Title + '\' + SL8.Title + '\' + SL9.Title + '\' + SL10.Title
END
END
END
END
END
END
END
END
END AS Path,
CASE
WHEN SL2.RecurseLevel IS NULL
THEN SL1.RecurseLevel
ELSE CASE
WHEN SL3.RecurseLevel IS NULL
THEN SL2.RecurseLevel
ELSE CASE
WHEN SL4.RecurseLevel IS NULL
THEN SL3.RecurseLevel
ELSE CASE
WHEN SL5.RecurseLevel IS NULL
THEN SL4.RecurseLevel
ELSE CASE
WHEN SL6.RecurseLevel IS NULL
THEN SL5.RecurseLevel
ELSE CASE
WHEN SL7.RecurseLevel IS NULL
THEN SL6.RecurseLevel
ELSE CASE
WHEN SL8.RecurseLevel IS NULL
THEN SL7.RecurseLevel
ELSE CASE
WHEN SL9.RecurseLevel IS NULL
THEN SL8.RecurseLevel
ELSE CASE
WHEN SL10.RecurseLevel IS NULL
THEN SL9.RecurseLevel
ELSE SL10.RecurseLevel
END
END
END
END
END
END
END
END
END AS RecurseLevel
FROM
cte_SuiteLevel_0 AS SL0
LEFT OUTER JOIN cte_SuiteLevel_1 AS SL1 ON SL1.ParentSuiteId = SL0.SuiteId
LEFT OUTER JOIN cte_SuiteLevel_2 AS SL2 ON SL2.ParentSuiteId = SL1.SuiteId
LEFT OUTER JOIN cte_SuiteLevel_3 AS SL3 ON SL3.ParentSuiteId = SL2.SuiteId
LEFT OUTER JOIN cte_SuiteLevel_4 AS SL4 ON SL4.ParentSuiteId = SL3.SuiteId
LEFT OUTER JOIN cte_SuiteLevel_5 AS SL5 ON SL5.ParentSuiteId = SL4.SuiteId
LEFT OUTER JOIN cte_SuiteLevel_6 AS SL6 ON SL6.ParentSuiteId = SL5.SuiteId
LEFT OUTER JOIN cte_SuiteLevel_7 AS SL7 ON SL7.ParentSuiteId = SL6.SuiteId
LEFT OUTER JOIN cte_SuiteLevel_8 AS SL8 ON SL8.ParentSuiteId = SL7.SuiteId
LEFT OUTER JOIN cte_SuiteLevel_9 AS SL9 ON SL9.ParentSuiteId = SL8.SuiteId
LEFT OUTER JOIN cte_SuiteLevel_10 AS SL10 ON SL10.ParentSuiteId = SL9.SuiteId
SELECT
SS.[ProjectId],
SS.[PlanId],
SS.[ParentSuiteId],
SS.[SuiteId],
SS.[ProjectName],
SS.[PlanName],
SS.[Path],
SS.[RecurseLevel]
FROM
SELECT DISTINCT
S.[ProjectId],
S.[PlanId],
S.[ParentSuiteId],
S.[SuiteId],
S.[ProjectName],
S.[PlanName],
S.[Path],
S.[RecurseLevel]
FROM
cte_Suites AS S
WHERE
S.[RecurseLevel] IS NOT NULL
AND S.[Path] IN $($SuitePaths)
) AS SS
ORDER BY
SS.[Path]
$Command.CommandText = $SQLStatement
$Command.Connection = $Connection
$Command.CommandTimeout = 240
$DataAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$DataAdapter.SelectCommand = $Command
$DataSet = New-Object System.Data.DataSet
$DataAdapter.Fill($DataSet) | Out-Null
Write-Output "$SQLStatement" | Out-File -FilePath $LogFile -Append
# --DEBUG ONLY--> $DataSet.Tables[0]
return $DataSet
3. Execute every suite in the record set via TCM
$DataSet = ( Retrieve-SuitePaths -LogFile:$LogFile -Connection:$Connection -Path:$Paths)
# --DEBUG ONLY--> $DataSet.Tables[0].Rows.Count
# --DEBUG ONLY--> $DataSet.Tables[0]
# Determine whether or not any test suites were retrieved from TFS....
if ( $DataSet.Tables[0].Rows.Count -gt 0 )
$ListTestRunID = $null
$SumFailed = 0
$SumInconclusive = 0
foreach ($Row in $DataSet.Tables[0].Rows)
# Set project, plan & suite variables....
[Int16]$ProjectID = $Row.Item('ProjectId')
[Int16]$PlanID = $Row.Item('PlanId')
[Int16]$ParentSuiteID = $Row.Item('ParentSuiteId')
[Int16]$SuiteID = $Row.Item('SuiteId')
$ProjectName = $Row.Item('ProjectName')
$PlanName = $Row.Item('PlanName')
$Path = $Row.Item('Path')
$RecurseLevel = $Row.Item('RecurseLevel')
# Set local build path variable....
switch -wildcard ($Path)
"*WebCMS*\Administration\*"
$CUITBuildPath = $CUITPathUNC + '\WebCMS\Administration'
"*WebCMS*\Instructor\*"
$CUITBuildPath = $CUITPathUNC + '\WebCMS\Instructor'
"*WebCMS*\Student\*"
$CUITBuildPath = $CUITPathUNC + '\WebCMS\Student'
"*WebProduct*\Instructor\*"
$CUITBuildPath = $CUITPathUNC + '\WebProduct\Instructor'
"*WebProduct*\Student\*"
$CUITBuildPath = $CUITPathUNC + '\WebProduct\Student'
default
$CUITBuildPath = $CUITPathUNC
Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
Write-Output 'Test Suite:' | Out-File -FilePath $LogFile -Append
Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
Write-Output " ID:" | Out-File -FilePath $LogFile -Append
Write-Output " Project: $ProjectID" | Out-File -FilePath $LogFile -Append
Write-Output " Plan: $PlanID" | Out-File -FilePath $LogFile -Append
Write-Output " Parent Suite: $ParentSuiteID" | Out-File -FilePath $LogFile -Append
Write-Output " Suite: $SuiteID" | Out-File -FilePath $LogFile -Append
Write-Output " Config: $ConfigurationID" | Out-File -FilePath $LogFile -Append
Write-Output " Name:" | Out-File -FilePath $LogFile -Append
Write-Output " Project: $ProjectName" | Out-File -FilePath $LogFile -Append
Write-Output " Plan: $PlanName" | Out-File -FilePath $LogFile -Append
Write-Output " Config: $ConfigurationName" | Out-File -FilePath $LogFile -Append
Write-Output " Path:" | Out-File -FilePath $LogFile -Append
Write-Output " Suite: $Path" | Out-File -FilePath $LogFile -Append
Write-Output " Build: $CUITBuildPath" | Out-File -FilePath $LogFile -Append
# --DEBUG ONLY--> Write-Output " Recursion: $RecurseLevel" | Out-File -FilePath $LogFile -Append
Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
# Set TCM arguements....
$ArguementPlanID = "/planid:$PlanID"
$ArguementTitle = "/title:$Title - $Path (SuiteID: $SuiteID)"
$ArguementSuiteID = "/suiteid:$SuiteID"
$ArguementConfigurationID = "/configid:$ConfigurationID"
$ArguementTFSCollection = "/collection:$TFSCollection"
$ArguementTeamProject = "/teamproject:$TFSTeamProject"
if(![string]::IsNullOrEmpty($CUITBuildPath))
$ArguementBuildDirectory = "/builddir:$CUITBuildPath"
$ArguementBuild = ""
$ArguementBuildDefinition = ""
else
$ArguementBuildDirectory = ""
$ArguementBuild = "/build:$TFSBuild"
$ArguementBuildDefinition = "/builddefinition:$BuildDefinition"
$ArguementTestEnvironment = "/testenvironment:$WebServer"
$ArguementSettingsName = ""
if(![string]::IsNullOrEmpty($SettingsName))
$ArguementSettingsName = "/settingsname:$SettingsName"
# Create test run....
Write-Host "$TCMEXE 'run' '/create' $ArguementTitle $ArguementPlanID $ArguementSuiteID $ArguementConfigurationID $ArguementTFSCollection $ArguementTeamProject $ArguementBuild $ArguementBuildDefinition $ArguementBuildDirectory $ArguementTestEnvironment $ArguementSettingsName"
Write-Output " $TCMEXE 'run' '/create' $ArguementTitle $ArguementPlanID $ArguementSuiteID $ArguementConfigurationID $ArguementTFSCollection $ArguementTeamProject $ArguementBuild $ArguementBuildDefinition $ArguementBuildDirectory $ArguementTestEnvironment $ArguementSettingsName" | Out-File -FilePath $LogFile -Append
try
$TestRunID = & $TCMEXE 'run' '/create' $ArguementTitle $ArguementPlanID $ArguementSuiteID $ArguementConfigurationID $ArguementTeamProject $ArguementTFSCollection $ArguementBuild $ArguementBuildDefinition $ArguementBuildDirectory $ArguementTestEnvironment $ArguementSettingsName
catch
$ExitMessage = $_Exception.Message
# --DEBUG ONLY--> Write-Output "TestRunID: $TestRunID" | Out-File -FilePath $LogFile -Append
if ($TestRunID -match '.+\:\s(?<TestRunID>\d+)\.')
# The test run ID is identified as a property in the match collection so we can access it directly by using the group name from the regular expression (i.e. TestRunID).
$TestRunID = $matches.TestRunID
$ArguementID = "/id:$TestRunID"
$TestRunResultsFile = $TempDirectory + "\TestRunResults$TestRunID.trx"
$ArguementQueryText = "/querytext:SELECT * FROM TestRun WHERE TestRunID=$TestRunID"
$ArguementResultsFile = "/resultsfile:""$TestRunResultsFile"""
Write-Host " Waiting for test run to complete ..."
Write-Host $TCMEXE 'run' '/list' $ArguementTeamProject $ArguementTFSCollection $ArguementQueryText
Write-Output " $TCMEXE 'run' '/list' $ArguementTeamProject $ArguementTFSCollection $ArguementQueryText" | Out-File -FilePath $LogFile -Append
$WaitingForTestRunCompletion = $true
$WaitCount= 0
while ($WaitingForTestRunCompletion)
$WaitCount = $WaitCount + 1
Write-Output " Waiting ($WaitCount)...." | Out-File -FilePath $LogFile -Append
Start-Sleep -s $TestRunWaitDelay
$TestRunStatus = & $TCMEXE 'run' '/list' $ArguementTeamProject $ArguementTFSCollection $ArguementQueryText
$TestRunStatus
if ($TestRunStatus.Count -lt 3 -or ($TestRunStatus.Count -gt 2 -and $TestRunStatus.GetValue(2) -match '.+(?<DateCompleted>\d+[/]\d+[/]\d+)'))
$WaitingForTestRunCompletion = $false
Write-Host "Evaluating test run $TestRunID results..."
# Take small pause(s) since the results might not be published yet....
Start-Sleep -s $TestRunWaitDelay
# Export results....
Write-Host $TCMEXE 'run' '/export' $ArguementID $ArguementTeamProject $ArguementTFSCollection $ArguementResultsFile
Write-Output " $TCMEXE 'run' '/export' $ArguementID $ArguementTeamProject $ArguementTFSCollection $ArguementResultsFile" | Out-File -FilePath $LogFile -Append
$WaitingForTestRunExport = $true
$WaitCount= 0
while ($WaitingForTestRunExport -and $WaitCount -lt 5)
$WaitCount = $WaitCount + 1
Write-Output " Waiting ($WaitCount)...." | Out-File -FilePath $LogFile -Append
$ExportResult = & $TCMEXE 'run' '/export' $ArguementID $ArguementResultsFile $ArguementTFSCollection $ArguementTeamProject
if ([System.IO.File]::Exists($TestRunResultsFile))
$WaitingForTestRunExport = $false
if ([System.IO.File]::Exists($TestRunResultsFile))
# Load the XML document contents.
[xml]$TestResultsXML = Get-Content "$TestRunResultsFile"
# Extract the results of the test run.
$TotalTests = $TestResultsXML.TestRun.ResultSummary.Counters.total
$PassedTests = $TestResultsXML.TestRun.ResultSummary.Counters.passed
$FailedTests = $TestResultsXML.TestRun.ResultSummary.Counters.failed
$InconclusiveTests = $TestResultsXML.TestRun.ResultSummary.Counters.inconclusive
# Output the results of the test run.
Write-Host "========== Test: $TotalTests tests ran, $PassedTests succeeded, $FailedTests failed, $InconclusiveTests inconclusive =========="
Write-Output "--------------------------------------------------------------------------------" | Out-File -FilePath $LogFile -Append
Write-Output "Summary:" | Out-File -FilePath $LogFile -Append
Write-Output "--------------------------------------------------------------------------------" | Out-File -FilePath $LogFile -Append
Write-Output " Total: $TotalTests" | Out-File -FilePath $LogFile -Append
Write-Output " Passed: $PassedTests" | Out-File -FilePath $LogFile -Append
Write-Output " Failed: $FailedTests" | Out-File -FilePath $LogFile -Append
Write-Output " Inconclusive: $InconclusiveTests" | Out-File -FilePath $LogFile -Append
$SumFailed += $FailedTests
$SumInconclusive += $InconclusiveTests
# Remove the test run results file.
[System.IO.File]::Delete($TestRunResultsFile) | Out-Null
# Add "current" TestRunID to the list of TestRunID(s)....
if ($ListTestRunID -ne $null)
$ListTestRunID = $ListTestRunID + ', '
$ListTestRunID = $ListTestRunID + $TestRunID
# Next test suite....
4. Extract record set of test runs from TFS via SQL query:
# FUNCTION: Retrieve-TestRuns
# Parameters:
# (1.) LogFile -- Name of log file (e.g., C:\Temp or C:\Temp\DEPLOY_DatabaseServer_WebCMS2_DF06_20131031.6.log)
# (2.) Connection -- Database connection
# (3.) ListTestRunID -- List of test run identifiers
Function Retrieve-TestRuns
param
[Parameter(Mandatory=$True)][String]$LogFile,
[Parameter(Mandatory=$True)]$Connection,
[Parameter(Mandatory=$True)][String]$ListTestRunID
Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
Write-Output "Retrieve test run(s): " | Out-File -FilePath $LogFile -Append
Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
$TestRuns = '(' + $ListTestRunID + ')'
$Command = New-Object System.Data.SqlClient.SqlCommand
$SQLStatement = "
WITH
cte_State
AS
SELECT 0 AS [StateID], 'Unspecified' AS [StateName]
UNION ALL
SELECT 1 AS [OutcomeId], 'To Be Determined (1)' AS [StateName]
UNION ALL
SELECT 2 AS [StateID], 'In Progress' AS [StateName]
UNION ALL
SELECT 3 AS [StateID], 'Completed' AS [StateName]
UNION ALL
SELECT 4 AS [StateID], 'Aborted' AS [StateName]
UNION ALL
SELECT 5 AS [OutcomeId], 'To Be Determined (5)' AS [StateName]
UNION ALL
SELECT 6 AS [StateID], 'Needs Investigation' AS [StateName]
SELECT
TR.[ProjectId] AS [Project Id],
P.[ProjectName],
TR.[TestPlanId] AS [Plan Id],
TP.Name AS [TestPlanName],
TR.[TestRunId] AS [Run Id],
TR.[Title],
S.[StateID] AS [State Id],
S.[StateName] AS [State],
TR.[StartDate] AS [Date Started],
TR.[CompleteDate] AS [Date Completed],
DATEDIFF(SECOND, TR.[StartDate], TR.[CompleteDate]) AS Duration,
TR.[Type],
TR.[IsAutomated],
TR.[TotalTests] AS [Total],
TR.[PassedTests] AS [Passed],
TR.[IncompleteTests] AS [Incomplete],
TR.[UnanalyzedTests] AS [Unanalyzed],
TR.[NotApplicableTests] AS [Not Applicable]
FROM
[Tfs_DefaultCollection].[dbo].[tbl_TestRun] AS TR
INNER JOIN [Tfs_DefaultCollection].[dbo].[tbl_Project] AS P ON TR.ProjectId = P.ProjectId
INNER JOIN [Tfs_DefaultCollection].[dbo].[tbl_Plan] AS TP ON TR.TestPlanId = TP.PlanId
INNER JOIN cte_State AS S ON TR.[State] = S.[StateID]
WHERE
TR.TestRunId IN $($TestRuns)
ORDER BY
TR.[StartDate]
$Command.CommandText = $SQLStatement
$Command.Connection = $Connection
$Command.CommandTimeout = 30
$DataAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$DataAdapter.SelectCommand = $Command
$DataSet = New-Object System.Data.DataSet
$DataAdapter.Fill($DataSet) | Out-Null
Write-Output "$SQLStatement" | Out-File -FilePath $LogFile -Append
# --DEBUG ONLY--> $DataSet.Tables[0]
return $DataSet
5. Extract record set of test results from TFS via SQL query:
# FUNCTION: Retrieve-TestRunResults
# Parameters:
# (1.) LogFile -- Name of log file (e.g., C:\Temp or C:\Temp\DEPLOY_DatabaseServer_WebCMS2_DF06_20131031.6.log)
# (2.) Connection -- Database connection
# (3.) ListTestRunID -- List of test run identifiers
Function Retrieve-TestRunResults
param
[Parameter(Mandatory=$True)][String]$LogFile,
[Parameter(Mandatory=$True)]$Connection,
[Parameter(Mandatory=$True)][String]$ListTestRunID
Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
Write-Output "Retrieve test result(s): " | Out-File -FilePath $LogFile -Append
Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
$TestRuns = '(' + $ListTestRunID + ')'
$Command = New-Object System.Data.SqlClient.SqlCommand
$SQLStatement = "
WITH
cte_Outcome
AS
SELECT 0 AS [OutcomeId], 'To Be Determined (0)' AS [OutcomeName]
UNION ALL
SELECT 1 AS [OutcomeId], 'In Progress' AS [OutcomeName]
UNION ALL
SELECT 2 AS [OutcomeId], 'Passed' AS [OutcomeName]
UNION ALL
SELECT 3 AS [OutcomeId], 'Failed' AS [OutcomeName]
UNION ALL
SELECT 4 AS [OutcomeId], 'Inconclusive' AS [OutcomeName]
UNION ALL
SELECT 5 AS [OutcomeId], 'To Be Determined (5)' AS [OutcomeName]
UNION ALL
SELECT 6 AS [OutcomeId], 'Aborted' AS [OutcomeName]
UNION ALL
SELECT 7 AS [OutcomeId], 'Blocked' AS [OutcomeName]
UNION ALL
SELECT 8 AS [OutcomeId], 'Not Executed' AS [OutcomeName]
UNION ALL
SELECT 10 AS [OutcomeId], 'Error' AS [OutcomeName]
UNION ALL
SELECT 11 AS [OutcomeId], 'Not Applicable' AS [OutcomeName]
UNION ALL
SELECT 12 AS [OutcomeId], 'Paused' AS [OutcomeName]
UNION ALL
SELECT 13 AS [OutcomeId], 'To Be Determined (13)' AS [OutcomeName]
UNION ALL
SELECT 255 AS [OutcomeId], 'Never Run' AS [OutcomeName]
cte_State
AS
SELECT 0 AS [StateID], 'None' AS [StateName]
UNION ALL
SELECT 1 AS [StateID], 'Ready' AS [StateName]
UNION ALL
SELECT 2 AS [StateID], 'Completed' AS [StateName]
UNION ALL
SELECT 3 AS [StateID], 'Not Ready' AS [StateName]
UNION ALL
SELECT 4 AS [StateID], 'In Progress' AS [StateName]
UNION ALL
SELECT 5 AS [StateID], 'To Be Determined' AS [StateName]
SELECT DISTINCT
TR.[TestRunId] AS [Run Id],
TR.[TestCaseId] AS [Case Id],
O.[OutcomeID] AS [Outcome Id],
O.[OutcomeName] AS [Outcome],
S.[StateID] AS [State Id],
S.[StateName] AS [State],
TR.[TestCaseTitle] AS [Title],
TR.[AutomatedTestName] AS [Automation Method],
TR.[DateStarted] AS [Date Started],
TR.[DateCompleted] AS [Date Completed],
DATEDIFF(SECOND, TR.[DateStarted], TR.[DateCompleted]) AS Duration,
TR.[FailureType] AS [Failure Type],
TR.[ErrorMessage] AS [Error]
FROM
[Tfs_DefaultCollection].[dbo].[tbl_TestResult] AS TR
INNER JOIN cte_Outcome AS O ON TR.Outcome = O.OutcomeID
INNER JOIN cte_State AS S ON TR.State = S.StateID
WHERE
TR.TestRunId IN $($TestRuns)
ORDER BY
TR.[TestRunId],
O.[OutcomeName],
TR.[TestCaseTitle]
$Command.CommandText = $SQLStatement
$Command.Connection = $Connection
$Command.CommandTimeout = 30
$DataAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$DataAdapter.SelectCommand = $Command
$DataSet = New-Object System.Data.DataSet
$DataAdapter.Fill($DataSet) | Out-Null
Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
Write-Output "SQL Statement: " | Out-File -FilePath $LogFile -Append
Write-Output '--------------------------------------------------------------------------------' | Out-File -FilePath $LogFile -Append
Write-Output "$SQLStatement" | Out-File -FilePath $LogFile -Append
# --DEBUG ONLY--> $DataSet.Tables[0]
return $DataSet
6. Email results to distribution list
Currently, I'm simplifying the extraction of suite path ... replacing hardcoded depth with STUFF() & XML PATH
Carl. -
How to Find the Queries that are not hitting the indexes..
Guys,
Hope you all doin well.
Would you guys please tell me any view , or any resource that can help me to identify those SQL Statements that are not hitting the indexes properly, Causing the system to slow down at peak times.
Thanks
Rgrds
Y.Vo.any resource that can help me to identify those SQL Statements that are not hitting the indexes properlyInteresting ! Is there any specific reason of looking only for those queries, which are not making proper use of indexes.
hare krishna
Alok -
How to find the objects that are used for a particular BEx query
Hi ,
I am preparing the inventory for BEx queries. Means for a particular BEx query I want to know the correcsponding
1. Selection screen variables
2. Characteristics
3. Restrcited, Calculated and normal key figures.
I have checked all the BEx query related tabe but unable to find the proper relation between these tables to get the desired output.
Can you help for table joins to get the output as mentioned above.
Thanks in advance.
Regards,
SaiHi,
you want find the total information about query details use the T CODE - RSRTQ.
give the proper selection then execute.
please find the doc.
RSRTQ – Query Definition – Multipurpose T-Code on BEx Queries
Thanks,
Phani. -
How to find the instances that are running in a server?
i have a Solaris server and previous engineer did a custom install of multiple instances of oracles.
how can i find out the instances? such as instance name, port, database name, etc.
thanks.user1035690 wrote:
i have a Solaris server and previous engineer did a custom install of multiple instances of oracles.
how can i find out the instances? such as instance name, port, database name, etc.
thanks.For currently running instances:
ps -ef | grep ora | grep pmonPort is for listener configuration and 1 listener can serve to multiple instances. You should check listener.ora file.
Teymur Hajiyev
Oracle 10g Certified Master
http://teymur-hajiyev.blogspot.com
http://dba.az -
How to Show All Packages, That are not required by any other package
I need a way to see al the installed packages thar are not required by any other package
Thanks in advance ...You probably want pacman -Qt or pacman -Qdt
Check out man pacman.
Maybe you are looking for
-
How do I change stills with each menu item selected?
Hi all. I am trying to create a menu (with 10 items) which contains one single dropzone box, which will contain a still that changes with each menu item selected (instead of 10 different stills next to each item). I have absolutely no idea how to ach
-
When I try to open a 'Pages' file the Bluetooth File Exchange pops up and asks for a bluetooth device to send this file to!!! Please can anyone help?
-
Each day at random times my phone goes out stating Sim card not found. i was hoping there was a fix in todays update but of course no update. i have been travelling so i cannot back up etc. I have done the reset, the hard reset, and plug into the ele
-
Please help me, I copied a pdf to my desktop to remove some pages, when I go to my original PDF, it's been althered the same way my copy was??? Also, after a numbers of time, I delete everything from my desktop, I keep the folder where I've stored my
-
Template "boxes" lose formatting when photos inserted
Ok, so I created a template for a section of my book (an iPad edition of a high school yearbook). The template uses rectangular shapes defined as media placeholders. In addition, these boxes have been given a caption, which has been deleted as the ca