コード例 #1
0
ファイル: logging_test.go プロジェクト: cloudfoundry/guardian
					handles = append(handles, container.Handle())
					// create process
					process, err := container.Run(garden.ProcessSpec{Path: "/bin/ls"}, garden.ProcessIO{})
					Expect(err).NotTo(HaveOccurred())
					_, err = process.Wait()
					Expect(err).NotTo(HaveOccurred())

					// bulkinfo
					_, err = client.BulkInfo(handles)
					Expect(err).NotTo(HaveOccurred())
					_, err = client.BulkMetrics(handles)
					Expect(err).NotTo(HaveOccurred())
				}

				// destroy containers
				Expect(client.DestroyContainers()).To(Succeed())
			})

			AfterEach(func() {
				Expect(client.DestroyAndStop()).To(Succeed())
			})

			It("doesn't log too many messages", func() {
				outLines := strings.Split(string(client.Buffer().Contents()), "\n")
				Expect(len(outLines)).To(BeNumerically("<", 300))
			})
		})
	})

	Context("when a nonsense log-level is passed", func() {
		BeforeEach(func() {