544 lines
13 KiB
JSON
544 lines
13 KiB
JSON
{
|
|
"description": "command-logging",
|
|
"schemaVersion": "1.13",
|
|
"createEntities": [
|
|
{
|
|
"client": {
|
|
"id": "client",
|
|
"observeLogMessages": {
|
|
"command": "debug"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"database": {
|
|
"id": "database",
|
|
"client": "client",
|
|
"databaseName": "logging-tests"
|
|
}
|
|
},
|
|
{
|
|
"collection": {
|
|
"id": "collection",
|
|
"database": "database",
|
|
"collectionName": "logging-tests-collection"
|
|
}
|
|
},
|
|
{
|
|
"session": {
|
|
"id": "session",
|
|
"client": "client"
|
|
}
|
|
}
|
|
],
|
|
"initialData": [
|
|
{
|
|
"collectionName": "logging-tests-collection",
|
|
"databaseName": "logging-tests",
|
|
"documents": [
|
|
{
|
|
"_id": 1,
|
|
"x": 11
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"tests": [
|
|
{
|
|
"description": "A successful command",
|
|
"operations": [
|
|
{
|
|
"name": "runCommand",
|
|
"object": "database",
|
|
"arguments": {
|
|
"command": {
|
|
"ping": 1
|
|
},
|
|
"commandName": "ping"
|
|
}
|
|
}
|
|
],
|
|
"expectLogMessages": [
|
|
{
|
|
"client": "client",
|
|
"messages": [
|
|
{
|
|
"level": "debug",
|
|
"component": "command",
|
|
"data": {
|
|
"message": "Command started",
|
|
"databaseName": "logging-tests",
|
|
"commandName": "ping",
|
|
"command": {
|
|
"$$matchAsDocument": {
|
|
"$$matchAsRoot": {
|
|
"ping": 1,
|
|
"$db": "logging-tests"
|
|
}
|
|
}
|
|
},
|
|
"requestId": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"serverHost": {
|
|
"$$type": "string"
|
|
},
|
|
"serverPort": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"level": "debug",
|
|
"component": "command",
|
|
"data": {
|
|
"message": "Command succeeded",
|
|
"databaseName": "logging-tests",
|
|
"commandName": "ping",
|
|
"reply": {
|
|
"$$type": "string"
|
|
},
|
|
"requestId": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"serverHost": {
|
|
"$$type": "string"
|
|
},
|
|
"serverPort": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"durationMS": {
|
|
"$$type": [
|
|
"double",
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "A failed command",
|
|
"operations": [
|
|
{
|
|
"name": "find",
|
|
"object": "collection",
|
|
"arguments": {
|
|
"filter": {
|
|
"$or": true
|
|
}
|
|
},
|
|
"expectError": {
|
|
"isClientError": false
|
|
}
|
|
}
|
|
],
|
|
"expectLogMessages": [
|
|
{
|
|
"client": "client",
|
|
"messages": [
|
|
{
|
|
"level": "debug",
|
|
"component": "command",
|
|
"data": {
|
|
"message": "Command started",
|
|
"databaseName": "logging-tests",
|
|
"commandName": "find",
|
|
"command": {
|
|
"$$type": "string"
|
|
},
|
|
"requestId": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"serverHost": {
|
|
"$$type": "string"
|
|
},
|
|
"serverPort": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"level": "debug",
|
|
"component": "command",
|
|
"data": {
|
|
"message": "Command failed",
|
|
"databaseName": "logging-tests",
|
|
"commandName": "find",
|
|
"failure": {
|
|
"$$exists": true
|
|
},
|
|
"requestId": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"serverHost": {
|
|
"$$type": "string"
|
|
},
|
|
"serverPort": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"durationMS": {
|
|
"$$type": [
|
|
"double",
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "A successful commitTransaction command",
|
|
"runOnRequirements": [
|
|
{
|
|
"topologies": [
|
|
"replicaset",
|
|
"sharded"
|
|
]
|
|
}
|
|
],
|
|
"operations": [
|
|
{
|
|
"name": "startTransaction",
|
|
"object": "session"
|
|
},
|
|
{
|
|
"name": "insertOne",
|
|
"object": "collection",
|
|
"arguments": {
|
|
"session": "session",
|
|
"document": {
|
|
"_id": 2,
|
|
"x": 22
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "commitTransaction",
|
|
"object": "session"
|
|
}
|
|
],
|
|
"expectLogMessages": [
|
|
{
|
|
"client": "client",
|
|
"messages": [
|
|
{
|
|
"level": "debug",
|
|
"component": "command",
|
|
"data": {
|
|
"message": "Command started",
|
|
"databaseName": "logging-tests",
|
|
"commandName": "insert",
|
|
"command": {
|
|
"$$type": "string"
|
|
},
|
|
"requestId": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"serverHost": {
|
|
"$$type": "string"
|
|
},
|
|
"serverPort": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"level": "debug",
|
|
"component": "command",
|
|
"data": {
|
|
"message": "Command succeeded",
|
|
"databaseName": "logging-tests",
|
|
"commandName": "insert",
|
|
"reply": {
|
|
"$$type": "string"
|
|
},
|
|
"requestId": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"serverHost": {
|
|
"$$type": "string"
|
|
},
|
|
"serverPort": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"durationMS": {
|
|
"$$type": [
|
|
"double",
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"level": "debug",
|
|
"component": "command",
|
|
"data": {
|
|
"message": "Command started",
|
|
"databaseName": "admin",
|
|
"commandName": "commitTransaction",
|
|
"command": {
|
|
"$$type": "string"
|
|
},
|
|
"requestId": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"serverHost": {
|
|
"$$type": "string"
|
|
},
|
|
"serverPort": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"level": "debug",
|
|
"component": "command",
|
|
"data": {
|
|
"message": "Command succeeded",
|
|
"databaseName": "admin",
|
|
"commandName": "commitTransaction",
|
|
"reply": {
|
|
"$$type": "string"
|
|
},
|
|
"requestId": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"serverHost": {
|
|
"$$type": "string"
|
|
},
|
|
"serverPort": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"durationMS": {
|
|
"$$type": [
|
|
"double",
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "A successful abortTransaction command",
|
|
"runOnRequirements": [
|
|
{
|
|
"topologies": [
|
|
"replicaset",
|
|
"sharded"
|
|
]
|
|
}
|
|
],
|
|
"operations": [
|
|
{
|
|
"name": "startTransaction",
|
|
"object": "session"
|
|
},
|
|
{
|
|
"name": "insertOne",
|
|
"object": "collection",
|
|
"arguments": {
|
|
"session": "session",
|
|
"document": {
|
|
"_id": 3,
|
|
"x": 33
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "abortTransaction",
|
|
"object": "session"
|
|
}
|
|
],
|
|
"expectLogMessages": [
|
|
{
|
|
"client": "client",
|
|
"messages": [
|
|
{
|
|
"level": "debug",
|
|
"component": "command",
|
|
"data": {
|
|
"message": "Command started",
|
|
"databaseName": "logging-tests",
|
|
"commandName": "insert",
|
|
"command": {
|
|
"$$type": "string"
|
|
},
|
|
"requestId": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"serverHost": {
|
|
"$$type": "string"
|
|
},
|
|
"serverPort": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"level": "debug",
|
|
"component": "command",
|
|
"data": {
|
|
"message": "Command succeeded",
|
|
"databaseName": "logging-tests",
|
|
"commandName": "insert",
|
|
"reply": {
|
|
"$$type": "string"
|
|
},
|
|
"requestId": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"serverHost": {
|
|
"$$type": "string"
|
|
},
|
|
"serverPort": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"durationMS": {
|
|
"$$type": [
|
|
"double",
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"level": "debug",
|
|
"component": "command",
|
|
"data": {
|
|
"message": "Command started",
|
|
"databaseName": "admin",
|
|
"commandName": "abortTransaction",
|
|
"command": {
|
|
"$$type": "string"
|
|
},
|
|
"requestId": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"serverHost": {
|
|
"$$type": "string"
|
|
},
|
|
"serverPort": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"level": "debug",
|
|
"component": "command",
|
|
"data": {
|
|
"message": "Command succeeded",
|
|
"databaseName": "admin",
|
|
"commandName": "abortTransaction",
|
|
"reply": {
|
|
"$$type": "string"
|
|
},
|
|
"requestId": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"serverHost": {
|
|
"$$type": "string"
|
|
},
|
|
"serverPort": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
},
|
|
"durationMS": {
|
|
"$$type": [
|
|
"double",
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|