All of lore.kernel.org
 help / color / mirror / Atom feed
From: method@manicmethod.com
To: selinux@tycho.nsa.gov, kmacmillan@mentalrootkit.com
Subject: [POLICYREP] [RFC/PATCH 3/3] policy package tests
Date: Tue, 17 Jul 2007 11:03:39 -0400	[thread overview]
Message-ID: <20070717150443.678122397@manicmethod.com> (raw)
In-Reply-To: 20070717150336.135143158@manicmethod.com

--

--- a/libpolicyrep/tests/libpolicyrep-test.cpp	(revision 2495)
+++ b/libpolicyrep/tests/libpolicyrep-test.cpp	(working copy)
@@ -20,6 +20,7 @@
 
 #include <policyrep/policy.hpp>
 #include <policyrep/parse.hpp>
+#include <policyrep/policy_package.hpp>
 
 #include <sstream>
 #include <iostream>
@@ -57,6 +58,27 @@
 
 	parsed_mod->append_children(mod->children().begin(), mod->children().end());
 
+	// policy package teddsts
+	std::cout << "============ Reading policy package ===========" << std::endl;
+
+	try {
+		PolicyPackagePtr polpackage(new PolicyPackage("policy_package/test.xar"));
+		const std::string fc = polpackage->get_file_contexts();
+		if (fc.empty())
+			std::cout << "Error, file_contexts file not in package" << std::endl;
+		const std::string su = polpackage->get_seusers();
+		if (su.empty())
+			std::cout << "Error, seusers file not in package" << std::endl;
+		const std::string ue = polpackage->get_user_extra();
+		if (ue.empty())
+			std::cout << "Error, user_extra file not in package" << std::endl;
+		const std::string nc = polpackage->get_netfilter_contexts();
+		if (nc.empty())
+			std::cout << "Error, netfilter_contexts file not in package" << std::endl;
+	} catch (const char *e) {
+		std::cout << "Exception thrown: " << e << std::endl;
+	}
+
 }
 
 int main(int argc, char **argv)
--- a/libpolicyrep/tests/Makefile	(revision 2495)
+++ b/libpolicyrep/tests/Makefile	(working copy)
@@ -12,7 +12,7 @@
 all: $(EXE)
 
 $(EXE): $(objs) $(LIBPOLICYREP)
-	g++ $(CFLAGS) $(objs) $(LIBPOLICYREP) -lboost_serialization -o $@
+	g++ $(CFLAGS) $(objs) $(LIBPOLICYREP) -lboost_serialization -lxar -o $@
 
 %.o:  %.cpp
 	g++ $(CFLAGS) -fPIC -c -o $@ $<

-- 

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

      parent reply	other threads:[~2007-07-17 15:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-17 15:03 [POLICYREP] [RFC/PATCH 0/3] policy package implementation with xar method
2007-07-17 15:03 ` [POLICYREP] [RFC/PATCH 1/3] policy package class method
2007-07-17 15:31   ` Karl MacMillan
2007-07-17 16:23     ` Joshua Brindle
2007-07-17 18:30       ` Karl MacMillan
2007-07-17 20:33         ` Joshua Brindle
2007-07-17 21:01           ` Karl MacMillan
2007-07-17 15:03 ` [POLICYREP] [RFC/PATCH 2/3] policy package implementation method
2007-07-17 15:38   ` Karl MacMillan
2007-07-17 16:40     ` Joshua Brindle
2007-07-17 18:35       ` Karl MacMillan
2007-07-17 20:48         ` Joshua Brindle
2007-07-17 20:48         ` Joshua Brindle
2007-07-17 20:56           ` Karl MacMillan
2007-07-17 21:01             ` Joshua Brindle
2007-07-17 21:11               ` Karl MacMillan
2007-07-18 12:32                 ` Christopher J. PeBenito
2007-07-17 15:03 ` method [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070717150443.678122397@manicmethod.com \
    --to=method@manicmethod.com \
    --cc=kmacmillan@mentalrootkit.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.